This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: BaseServer.shutdown documentation is incomplete
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: georg.brandl, ggenellina, python-dev, r.david.murray, sandro.tosi
Priority: normal Keywords: patch

Created on 2009-05-15 23:57 by ggenellina, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
socketserver.rst.diff ggenellina, 2009-11-15 12:05
issue6031-py3k-v2.patch sandro.tosi, 2010-09-26 09:28
Messages (6)
msg87845 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-05-15 23:57
BaseServer.shutdown is documented as "Tells the serve_forever() loop to 
stop and waits until it does."

The docstring is much more explicit: """Stops the serve_forever loop. 
Blocks until the loop has finished. This must be called while 
serve_forever() is running in another thread, or it will deadlock."""

Combined with #2302 I'd rewrite both (rst and docstring) as:

BaseServer.shutdown(): Tells the serve_forever() loop to stop, and 
waits until the loop has finished. This must be called after 
serve_forever() has started and while it is running in another thread, 
or the shutdown() call will deadlock."
msg95286 - (view) Author: Gabriel Genellina (ggenellina) Date: 2009-11-15 12:05
Documentation patch for BaseServer.server_forever() and shutdown()
msg117407 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2010-09-26 09:28
Hello,
I've refreshed this patch (correct the file name & because it applies now with an offset), other than that it seems ok: can someone review (it's quite small :) and apply it?

Thanks,
Sandro
msg117557 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-09-28 22:05
Hmm.  It seems as though since issue 2302 is now closed, the comment about deadlocking if called before serve_forever may no longer be true.  Gabriel?
msg150537 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-01-03 21:48
New changeset 4fad6b811c8b by Sandro Tosi in branch '2.7':
Issue #6031: improve serve_forever() description
http://hg.python.org/cpython/rev/4fad6b811c8b

New changeset 4a30d36a9c69 by Sandro Tosi in branch '3.2':
Issue #6031: improve serve_forever() description
http://hg.python.org/cpython/rev/4a30d36a9c69
msg150538 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2012-01-03 21:50
yep indeed, I've removed the deadlock part and committed.
History
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50281
2012-01-03 21:50:03sandro.tosisetstatus: open -> closed
versions: + Python 3.3, - Python 3.1
messages: + msg150538

resolution: fixed
stage: resolved
2012-01-03 21:48:50python-devsetnosy: + python-dev
messages: + msg150537
2010-10-29 10:07:21adminsetassignee: georg.brandl -> docs@python
2010-09-28 22:17:29r.david.murraysetversions: - Python 2.6, Python 3.0
2010-09-28 22:05:27r.david.murraysetnosy: + r.david.murray
messages: + msg117557
2010-09-26 09:28:08sandro.tosisetfiles: + issue6031-py3k-v2.patch
nosy: + sandro.tosi
messages: + msg117407

2009-11-15 12:05:55ggenellinasetfiles: + socketserver.rst.diff
keywords: + patch
messages: + msg95286
2009-05-15 23:57:55ggenellinacreate