New submission from Ama Aje My Fren <amaajemyf...@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@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue39797>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to