[issue12463] Calling SocketServer.shutdown() when server_forever() was not called will hang

Michael P. Reilly report at bugs.python.org
Fri Dec 23 02:40:16 CET 2011


Michael P. Reilly <arcege at gmail.com> added the comment:

I'm seeing that shutdown does have a race condition just using BaseHTTPServer.HTTPServer.  See the attached simple script.  Then access http://localhost:8081.  This is using both Python 2.6.6 (r266:84292, May 22 2011, 16:47:42) on Oracle Linux Server 6.1 and Python 2.7.2+ (default, Oct 4, 2011, 20:03:08) on Ubuntu 11.10.  I have applied the socketserver.patch dated 2011-07-25 18:43, with the same result.

The problem is that shutdown() waits for the event, which is never triggered since there is no thread to set the event.  I'll see if I can come up with a patch myself later this weekend.  I suspect the same might happen with ForkingMixIn.

----------
nosy: +Arcege
versions: +Python 2.6 -Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24083/simple.py

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


More information about the Python-bugs-list mailing list