- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
And I simply thought the "Transcoder" was a person. Like those old Monks who would translate the bible by candle light. I suspect they had Compuserve accounts (way back then).
Admin
This is what the standard has to say: " Delivery SMTP systems MAY reject ("bounce") such messages rather than deliver them."
It doesn't say too much about what that bounce entails. Different MTAs, or differenly configured MTAs, can reject messages at different stages of the process.
The code snippet supplied doesn't contain any error handling, so it will miss any errors that occur during the initial spooling at the local MTA (such as a rejection because the message is too large). If something goes wrong on the local MTA, it might give and error message, or it might send back a message; that bounce message might contain a reference that can be correllated back to the message that was sent. A typical bounce message is pretty useless even to human readers, and often doesn't include full headers from the sent message. And results may vary from the local spooling MTA and the remote MTA.
Even if no bounce is received, and you'd need to keep polling your own mailbox to look at those, the message may still not be received. In fact, the bounces may be bouncing because your own mailbox is full, or other such mishaps.
So, you'd need total control over both your local MTA, and the receiving MTA, so you can be 100% sure what their behavior is (no silently dropping e-mails!), what format their Delivery Status Notifications will be in (no changing the configuration!), and your own mailbox shouldn't fill up (we ARE talking about multi-megabyte messages here).
Now, the very concept of an asynchronous message isn't flat-out wrong. In fact, it's a great idea, if implemented correctly. That's why there are correct implementations of this idea, invariably called something like 'enterprise message business queue broker talk bus'.
Admin
Does anybody realize the link between SMTP and failures they observed? SMTP is not assured-delivery. It is practically impossible to detect a failure and correlate back to specific message. Bounce messages even if they arrive are pretty useless here - I don't know anyone that attempted to read and parse bounce messages. So if something went wrong somewhere, specific multimedia file will never be transcoded.
Admin
I'm gonna stop replying to this cause the rest is mostly just nonsense. Is SMTP the best way to deal with this? Who knows... with more reliable MTA's... maybe. Is it a giant WTF worth all the "on a table" gibberish? Not likely. Remember, your defenition of best != the next guy's. Maybe the original build requirement was "get me something by the end of the day that'll work", or "what can we do that's fast & cheap?" (which is a whole other WTF we've all had to deal with).
Anyway, I'm not meaning to be too hard on you... I'm just tired of dealing with similar logic on a day-to-day basis. Just because you can over-engineer something to never fail, doesn't mean it's always the best choice to do so.
Admin
I think its far more enterprisey to deliver it to a MQ-Series/Tibco type system. Of course, if you can't trust your email systems to deliver messages, then you truly are enterprisey. This is a good lightweight solution, until you throw in point'n'click crap email system administrators.
I say it would have been a huge WTF if they had reinvented the wheel and implemented their own queueing system, and paired it with making direct socket connections to the transcoding server.
Admin
This reminded me of a "Web 2.0" version of a transcoding service. It was cited as a case study of using Amazon Web Services to scale out on-the-fly, using Ruby on Rails and other new tech.
Wonder if they use email too?
http://info.rightscale.com/content/case_studies
Admin
Admin
I like the legal notice under Joe's comment better. Anyone who takes medical advice from programmers deserves a funeral home discount.
... These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. ...
Admin
Did what twice? Used a homonym of "too" in his username, rather than the proper spelling of the word?
Captcha: smile. It's a joke ;)
Admin
Admin
This is the kind of pragmatism money can't buy - when you're done realizing the cost of a Websphere license and drinking buzzword cool-aid, you'll realize that the Internet has had an extremely robust reliable messaging serving available since the dawn of time.
Seriously, when is the last time you had a legitimate e-mail silently dropped? I see nothing wrong with the code above. The guy deserves a bonus.
Admin
This is so eerie! I just learned today that one of my consulting Customers is purchasing an "e-commerce system" that will take orders online and send them to their in-house "line of business" system for processing. According to the vendor, each time an order is placed on the web site, an email will be sent from the web server to an address of my Customer's choosing. This email will have an XML file attached. Someone needs to open the email, save the XML file to disk, and do an "Import new order" in the "line of business" application such that the order can be processed. sigh
I listened to the presentation and kept thinking to myself "I should write this up for DailyWTF..."
Guess I don't have to.
Admin
The possibilities resolve to three:
You have not seen very many large systems.
You do not understand how to program in Perl.
You program by the "cut and paste Java samples from Google searches" method.
I do hope that after you have had a chance to work in the industry for more that a month or two, you will realize that just because you don't know what to do when confronted by something beyond your comprehension does not mean that all others are so limited in capability...
Admin
And then there's just using SMTP for huge media files, which is in it's very own class of stupid. If anything it's underengineered.
Consider the wide range of alternatives. FTP, SSH/SFTP, rsync, HTTP post are all pretty much synchronous and have clear, defined ways to deal with errors.
SMTP was never meant to send binary files, isn't even 8-bit safe, in the real world it doesn't handle big (media) files, and doesn't have clearly defined error handling. It's not robust.
You can just as well argue "hey, maybe using DNS tunneling was the best way of doing it!" - simply because an application can be abused beyond its original purposes doesn't make it close to a good idea. "Get me something by the end of the day" is a "requirement" that leads to WTFs, not a valid excuse for them.
Oh, as for the 'you can't know about errorhandling' - notice the absense of any 'throw' declaration, and the absence of 'try'/'catch'.
Besides, it's pretty clear this setup got submitted as a WTF precisely because it was unfit for its purpose - it didn't work!
Admin
As was stated before:
"it appears that only the request is sent via SMTP. The actual file upload happens later. "
the xml request that is being sent to the transcoder only seems to include info that a new media file has been uploaded and where it is located.
Not really a WTF in my opinion.
Admin
This is not a WTF as pointed out before. The media file upload is done elsewhere.
The problem Toti has is that all of the employees got laid off 3 weeks before christmas last year without pay so he doesn't have anybody with knowledge of the codebase to maintain it for him.
Admin
It is almost kind of a WTF, because the administrators must now correctly configure and keep track of more services. I wonder if the system documentation says so anywhere.
Admin
RFC 1149 really has been implemented, see this.
Admin
Absence of a bounce?? You mean the developers have to implement functionality in the sender to receive bounceback messages and then try to match it to the original request?
At least with HTTP could know immediately whether or not it made it into the queue at all. AND you don't have to impelement bounceback processing... which could get rather complex because you would have to parse MTA specific messages.
I'm going to make note of your name and be sure never to work with you.
-matthew
Admin
Why, of course if you want to put XML into a SOAP call, you have to encode it! Otherwise, how could you pass it as a string?
(Never mind that the data needs to be parsed twice, once to remove the SOAP envelope, and then again to parse the actual data.)
A former colleague of mine did exactly this some years ago. He was viewed by himself and several others as a quite intelligent Java programmer, so I suppose it was the right thing to do. I didn't understand it back then either. Still don't, actually.
Sin Tax
(captha: cognac - yeah I could use one right now.)
Admin
Any chance you could explain what "Unregistered" means?
Just asking, trollie ...
Admin
Just a thought.
Me, I'm lurve sendmail. Such a wonderfully thought-out and ahem infinitely configurable protocol.
%"()&£---*&(%=X
(This probably means something in Sendmail configuration.)
Having worked with the only real hardware fault-tolerant system in history -- Stratus -- I would accept your aversion to "(some)things that never fail."
I do not, however, accept your presumption that an attempt to approach this limit is "over-engineering."
If anything: it's the only bit of engineering that allows all of us to describe software as an engineering discipline. With tolerances. Measurable. Y'know?
Admin
Ok so I did WTF when I first saw this.
Then I read the comments, I re-read the code, had a walk around the kitchen while I searched for some nicotine gum, and then thought to myself "The WTF here is a TRUE WTF for once because its the WTF I would say if I found another developer had so stupidly broken the implicit contract i.e. NOT to make more ***** work for me".
Maybe it was the original coder, maybe it was the original spec or maybe it was management who didnt want to pay the price, but someone, somewhere decided that they need not love, honour or obey (or even specify maybe!) the requirement that the system should be "RELIABLE"....hence Toti's WTF at seeing email used as a delivery method in a system where its obviously totally inappropriate. Poor Toti!
Emails is GREAT if you dont give a flying French faggot whether your message is actually delivered to your recipient(s)...but if you do (and I love the French)...well something a little more.....robust is called far.
Its a WTF.
Admin
That would be a WTF - but not for the reasons you think - it's a WTF because (until very recently) Exchange isn't an MTA. It doesn't include one. The IIS SMTP Service is what Exchange uses as an MTA, and it's /plenty/ robust.
Exchange 2007 breaks this slightly, by bundling an MTA (something that funnily enough, Exchange 5.5 did - with the Internet Mail Service, which was also fairly robust), but the behaviour of E2007's MTA at the protocol level clearly indicate it's based on the IIS6 smtpsvc codebase.
Admin
OK. Thanks for playing; but do you really, seriously think that anybody is going to read this crap?
Admin
It's plain idiocy.
Two servers, one protocol, and a Ring to bind them.
There is no. Repeat, no. Repeat for emphasis, no reason to handle messaging this way.
Only a fucking moron would choose to use SMTP as a messaging system between two servers.
Only a (possibly different) fucking moron would choose to defend such a decision.
The various RFC and SMTP variant comments are sad, sad, reflections on the state of software engineering today.
Jesus Java Fucking Christ..
I would far rather see this serialised through some horrid Java interface, or else see it synchronised at a hardware level via rsync or some such, or even sent over a TCP connection via XML (enterprisey!) with an ack.
The "solution" in the OP is clearly doomed. Let's all stop arguing about how this or that RFC might potentially make it ever so slightly more reliable.
It's doomed. Doomed, I tell you.
And I think that was the point of the post.
Admin
Round about a thousand lines of C++, Java, C#, take your pick.
And, the sad thing is, it would actually work. To requirements. As opposed to some piece of Sysadmin-mandated email shit that wasn't even designed to come near to requirements.
Do they pay you minimum wage in your job? Because, if they do, you're stiffing them on basic competence levels.
Admin
Agreed that SMTP is a reasonable messaging system. However, if the transcoding server listens on port 25, you lose half the benefits of STMP messaging. Much better to have a real mail server on port 25, so it can queue requests if the transcoder is temporarily down.
Admin
Part of the e smtp specification that is widely implemented is called delivery status notification (dsn) so indeed it is perfectly likely that someone could verify delivery within a time period.
Admin
LOL!
Admin
ZOMG. I can't believe people are defending using SMTP here.
The correct lightweight solution would be to have the upload server write the files to a shared directory and the transcoding server to periodically poll if any files are present.
Admin
Unless of course it's the only way to get around some corporate ICT rules that we haven't been told about.
Perhaps the two machines are on separate networks and no direct communication from the 'Upload Server' to the 'Transcoding Server' is allowed?
Perhaps only certain software is allowed ?
We don't know.
Admin
I make no comment of the WTF-ishness of the solution, but it's worth noting that Bugzilla uses email to move bugs between different Bugzilla systems, even if they are on the same server.
I assume that this is because it's flexible and (generally) universally available.
Admin
Admin
SMTP doesn't seem like that inelegant a solution here, but it really depends on how the transcoding server was implemented. The real WTF here is that we don't know how the story ended. What caused the transcoder to hang all the time? It's not as if x% of your messages will vanish into thin air because they're being transported via SMTP.
Admin
I've been programming commercially for 12 years, and first learned C eight years before that. I've designed and been lead developer on systems with 6 figure lines of code, and worked on other systems with seven figures lines of code. That's option one covered.
I contracted for much of the late 1990's, working in a mixture of C (for performance) and Perl (for convenience). However, when Java started to perform well, I switched from Perl, sick of fixing the spaghetti other people often wrote. As systems have bcome more powerful, and the Sun JVM more optimised, I've gradually stopped using C and C++. I'm pretty much guru level on Java and C, competent at C++ and would have once considered myself guru level at Perl. I've also maintained some FORTRAN 77 code, and written a fair bit of assembler. Overall, I used Perl every working day for five or six years, so that's option two taken care of.
As for understanding how to program, I work as a senior developer, designing large scale Java systems as well as the accompanying database schemas. I have written frameworks for everything from asynchronous messaging to MVC web publishing.
In short, confident I'm likely to win any pissing contest against you ...
Admin
Forget faxing, wooden tables, & SMTP. The most reliable transmission would be to print each request on standard paper, seal it in an envelope, and add it to the canvas mail bag. Once a week, the station master would hang the bag on the hook above the track, and wait for the daily steamer to come thundering by. At the end of the week, when the steamer comes by the other way, the station master waits by the receiving hook for the report of how many messages were delivered.
Points of failure can be minimized by creating cron jobs to shoo away large cows along the route, and performance monitoring to gauge when there is too much whiskey back in the caboose.
Admin
The real WTF here is some of your comments lol
Admin
good for you. go get a kitkat and give (us) a break.
a bigger wtf will come around when somebody decides they also need to use the system and the SMTP trans-coding server lives for much longer that it was probably ever meant to. i'm sure the l33t d00d who wrote this is quite chuffed with himself.
Admin
Ah yes, HTTP makes it easier to detect the errors. That I agree with 100%. Detecting errors with SMTP is ugly and non-trivial.
Now for the next question: once you have detected that the HTTP server isn't available at this precise moment, how do you handle that error? You still need the work done. But you're just client code and perhaps you don't have a queuing system handy to retry this stuff. So you either try once, dutifully stash the error in a log file that nobody checks, or you try again with some timeout and then dutifully stash the error message in a log file that nobody checks.
Basically, in the real world, when an HTTP failure happens, you know about, but there is often no plan to deal with it.
Meanwhile, if you use SMTP (and if your SMTP server isn't crap), it will take ownership of the responsibility for delivering the message and then the sender of the message can stop owning it.
Yes, it's imperfect (as evidenced by the fact that a developer sometimes had to give the system a smack to get it unstuck), but it's often better than forcing the queuing logic into client code.
Admin
Such hate! "Only a fucking moron" would get this worked up over something they know so little about - you've seen what, 20 lines of code here? And you suddenly know that because SMTP is involved, SMTP cannot but be the cause of an inevitable catastrophic failure...
Believe it or not, there are times and places where it is perfectly acceptable to produce a system reliable to fewer than 5 nines. Believe it or not, sometimes the Simple Message Transfer Protocol is a viable way to Simply Transfer Messages. And, horror of horrors, it might even work!
Some people need to learn a few simple phrases along the lines of "I am not the only person smarter than peat moss," or "the first thing I see that I don't like is not necessarily the cause of all evil in the universe." Maybe even "people I disagree with might not all be complete fucking morons." Because, really, it doesn't reflect badly on them at all when you call them that in public.
BTW - any statement that begins "there is no reason to..." is almost certainly false. Even if you add the implied "good."
Admin
As a former Sendmail administrator for a VBC, I feel confident I know the real WTF here. Or, rather, WTFs.
Applications which send SMTP messages do not, generally, send the messages via SMTP. They make a single attempt to send the message to the SMTP server, and disregard any error messages. I've only seen two exceptions to this, out of hundreds of applications. Note that, in my experience, far more application messages are lost because the nearest email server had a momentary load issue and the application failed to try the next MX or queue the message for another attempt than are lost due to message bouncing.
The worst problem with SMTP for message passing in general is that it frequently requires multiple hops to get to the destination. Even with fairly optimal routes, the total network cost is almost always at least twice the cost of a protocol which can deliver it directly (like, say, FTP, which was specifically designed to transfer files.)
Delivery time is at the mercy of the email system load. An email problem on any system it needs to go through can substantially delay the message, even if it's not a problem that causes the message to bounce.
The majority of programs I've seen which receive automated messages are only marginally better than my grandmother at reading email. For example, I've seen half a dozen that would core dump if they received an email with no 'From:' header - despite the fact that they never did anything with the From: header other than parsing it.
A message queue can be implemented for any protocol which indicates delivery status. It doesn't require explicit permission from the protocol.
In general, writing an application to parse the email is about as difficult as it is to write an application to receive the email through either a telnet or ssh connection.
TRWTF is that the email server is Sendmail using background DeliveryMode. I could explain why that's a WTF, but since nobody's likely to read this, I'll save my fingers to explain it elsewhere.