Fabien Royer wrote: > Just a thought...Could it be caused by a blocking socket > issue? If that's > the case, setting a timeout on the socket would resolve the > problem nicely.
How? Should I use timeoutsocket.py from http://www.timo-tasi.org/python/timeoutsocket.py ? Has anyone used this before? Rumor has it that this is being integrated into Python 2.3. > I think it would be better to figure out why the thread gets > "wedged" rather > than working around this problem. True. However, there are other benefits from spawning a thread to do the email -- it frees up the original thread to go ahead and process another request. (Which may make the site seem more responsive when you're getting errors.) > > In general, rather than launching too many threads (it gets > really costly on > the system when you get too many), why not have only one > thread feeding from > a queue? Sounds like a good idea. If that one thread wedges, the queue will get more and more full, which we can easily detect and print out warnings (and stop adding more items to the queue). We could also add another thread to take over for the wedged thread. > > You could also add a watchdog thread monitoring the email > sender. If the > watchdog sees that the sender is connected and has not done > anything for too > long, the watchdog could then close the socket connection to > the email > server forcibly, hence removing the "wedge" (assuming that > problems occur > because of blocking sockets). I'll think about that. I don't want to make this too complicated. - Geoff ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
