[issue39797] shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()

Ama Aje My Fren report at bugs.python.org
Sat Feb 29 08:04:26 EST 2020


New submission from Ama Aje My Fren <amaajemyfren at gmail.com>:

When a subclass of socketserver.BaseServer is running after calling serve_forever() and needs to be shutdown, it may be shut down by sending a [shutdown()](https://docs.python.org/3/library/socketserver.html#socketserver.BaseServer.shutdown). The thing is though that the shutdown() call must be run in a different thread than the one where the serve_forever() was called otherwise it will deadlock. This is documented in the [code](https://github.com/python/cpython/blob/3.8/Lib/socketserver.py#L244) but not in the documentation. It should be in the documentation as well as it is not obvious.

----------
assignee: docs at python
components: Documentation
messages: 362981
nosy: amaajemyfren, docs at python
priority: normal
severity: normal
status: open
title: shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39797>
_______________________________________


More information about the Python-bugs-list mailing list