An unexpected exception while sending a message jams the rest of the messages in the queue

[email protected]
Newsgroups gmane.comp.python.twisted.bugs
Message-ID <[email protected]>
New submission from teolicy <None>:

twisted.mail.relaymanager.SmartHostSMTPRelayingManager method checkStateMX (and _checkStateMX) are ran periodically to start SMTP delivery of ready-to-be-delivered queued messages.

If the queue has more than one message, and the handling of one of these messages triggers an unhandled exception for any reason, the other messages will remain 'jammed' in the queue (since the 'bad' message will never be sent, and since it is likely that every time we try to send it we hit the same exception, all other messages will never be evaluated).

While we hope such an unhandled exception should never happen, the possibility is always there and the price of jamming the whole queue is great enough that it may be prudent to place the contents of the loop over the queue in a broad try/except clause and do something with any unhandled exceptions rather than let them clog the queue.

One of the questions is what to do with the unhandled exceptions we trap - I suggest a simple log.err(caught_exception) is sufficient, as when the exception will bubble up to the reactor, that is what the reactor is going to do anyway.

----------
Type     : enhancement
Component: mail
Keywords : 
Priority : normal
Nosy     : 
----------
http://twistedmatrix.com/trac/ticket/3973
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.