[issue5715] listen socket close in SocketServer.ForkingMixIn.process_request()

Charles-François Natali report at bugs.python.org
Sat May 21 13:11:44 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

Thanks for reporting this, the current behaviour is clearly wrong. The child process doesn't need to - and shouldn't - inherit the server socket.
The custom idiom when writting such code is to close the new socket (well, in TCP) in the parent process, and close the server socket in the child process.
That's what the attached patch does.
Since I really doubt anyone using socketserver ever used the server's socket from the handler, this shouldn't be a problem for existing code (and the server's socket was never documented to be usable from the request handler).

----------
keywords: +needs review, patch
nosy: +charles-francois.natali, haypo
stage: test needed -> patch review
Added file: http://bugs.python.org/file22045/ss_fork_close.diff

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


More information about the Python-bugs-list mailing list