New submission from Ama Aje My Fren :
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....). 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@python
components: Documentation
messages: 362981
nosy: amaajemyfren, docs@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
https://bugs.python.org/issue39797
_______________________________________