On Wed, Mar 14, 2007, Jon Ribbens wrote: > Gordon Messmer <[EMAIL PROTECTED]> wrote: >> >> After some discussion, Aahz suggested that I discuss the problem here, >> on python-dev. He seemed to think that the problem I saw may have been >> an indication of a bug in python. Could anyone take a look at that >> thread and say whether it looks like a bug, or working with non-blocking >> sockets was the right thing to do? > > Well, not having to faff around with non-blocking IO is one of the > major advantages of threading, so if blocking IO is indeed the cause > of your problem then it certainly sounds like a bug in Python, or > possibly your operating system.
One small wrinkle (and the reason I suggested bringing this to python-dev): I suspect that the problem is not a bug, but simply the occasional failure of sockets. When that happens in a threaded app without timeouts, eventually threads "die" (block forever). But you apparently can't use timeouts with file-wrapped sockets, so if that's the problem, we need to pick one of: * switch to non-wrapped sockets * switch to non-blocking I/O for smtplib * make file-wrapped sockets work with timeouts (And please note that if my analysis is correct, we need to make the fix for non-threaded apps, it's just more unusual to encounter the problem there.) This level of design decision is beyond my capabilities. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "I disrespectfully agree." --SJM _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com