[issue1429] FD leak in SocketServer

Jeff McNeil report at bugs.python.org
Mon Mar 14 05:50:25 CET 2011


Jeff McNeil <jeff at jmcneil.net> added the comment:

I entirely forgot I had signed up to look, my apologies. 

I'm going through this w/ what's lying on Mercurial's tip, I can't reproduce it at all. I can raise exceptions of various flavors from within the handle method of a StreamRequestHandler and there are no leaking file descriptors.  

The only thing worthy of discusion, IMO, is the fact that raising an exception in a handle_error method of a subclass of BaseServer *does* cause the the self.shutdown_request to not run.  

Unless I'm mistaken, that does then leave the cleanup of that open socket to GC (but, at that point, anyone overriding handle_error method should know that). Does it make sense to run shutdown_request, even if handle_error throws an Exception?  

If anyone thinks that's worthwhile, I can do that.

----------

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


More information about the Python-bugs-list mailing list