[issue6589] smtpd.SMTPServer can cause asyncore.loop to enter infinite event loop

Giampaolo Rodola' report at bugs.python.org
Wed May 19 15:44:04 CEST 2010


Giampaolo Rodola' <g.rodola at gmail.com> added the comment:

Could you provide an actual example code which reproduces this problem?
It's not clear to me how the dispatcher instance can end up in an "invalid state" since handle_error() should automatically remove the "invalid dispatcher instance" from the socket_map if anything unexpected happens.
If this doesn't happen it might be a problem related with what you've in your subclass (e.g. you have overridden handle_error and avoided to call close() yourself).

Furthermore the use case you have described it's pretty uncommon as you shouldn't run SMTPServer in a thread in the first place.

If you intend to bind two servers simultaneously you just have to instantiate two STMPServer sub/classes and finally call asyncore.loop().
Both instances will automatically be served by asyncore itself.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6589>
_______________________________________


More information about the Python-bugs-list mailing list