Issue 39797: shutdown() in socketserver.BaseServer should be in a different thread from serve_forever()
Issue39797
Created on 2020-02-29 13:04 by amaajemyfren, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 18926 | closed | amaajemyfren, 2020-03-11 14:59 | |
| PR 18929 | merged | amaajemyfren, 2020-03-11 16:08 | |
| PR 18930 | closed | amaajemyfren, 2020-03-11 16:24 | |
| PR 18932 | closed | amaajemyfren, 2020-03-11 16:34 | |
| PR 18933 | closed | amaajemyfren, 2020-03-11 16:40 | |
| PR 19085 | merged | miss-islington, 2020-03-20 08:03 | |
| PR 19086 | merged | miss-islington, 2020-03-20 08:03 | |
| Messages (5) | |||
|---|---|---|---|
| msg362981 - (view) | Author: Ama Aje My Fren (amaajemyfren) * | Date: 2020-02-29 13:04 | |
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. |
|||
| msg364652 - (view) | Author: miss-islington (miss-islington) | Date: 2020-03-20 08:03 | |
New changeset 2de7ac97981c30e9c1001b05a771f52a41772c54 by amaajemyfren in branch 'master': bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929) https://github.com/python/cpython/commit/2de7ac97981c30e9c1001b05a771f52a41772c54 |
|||
| msg364653 - (view) | Author: miss-islington (miss-islington) | Date: 2020-03-20 08:08 | |
New changeset 64937d308c71a5c95627b0a0d0574d164c0cf30a by Miss Islington (bot) in branch '3.7': bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929) https://github.com/python/cpython/commit/64937d308c71a5c95627b0a0d0574d164c0cf30a |
|||
| msg364654 - (view) | Author: miss-islington (miss-islington) | Date: 2020-03-20 08:08 | |
New changeset 29723368e797f36ba8940f25b6e677852b7313b2 by Miss Islington (bot) in branch '3.8': bpo-39797 Changes to socketserver.BaseServer's shutdown() method. (GH-18929) https://github.com/python/cpython/commit/29723368e797f36ba8940f25b6e677852b7313b2 |
|||
| msg364655 - (view) | Author: Ned Deily (ned.deily) * ![]() |
Date: 2020-03-20 08:15 | |
Thank you for your PR! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:27 | admin | set | github: 83978 |
| 2020-03-20 08:15:34 | ned.deily | set | status: open -> closed type: enhancement -> messages:
+ msg364655 |
| 2020-03-20 08:08:56 | miss-islington | set | messages: + msg364654 |
| 2020-03-20 08:08:51 | miss-islington | set | messages: + msg364653 |
| 2020-03-20 08:03:42 | miss-islington | set | pull_requests: + pull_request18446 |
| 2020-03-20 08:03:34 | miss-islington | set | pull_requests: + pull_request18445 |
| 2020-03-20 08:03:21 | miss-islington | set | nosy:
+ miss-islington messages: + msg364652 |
| 2020-03-11 16:40:12 | amaajemyfren | set | pull_requests: + pull_request18285 |
| 2020-03-11 16:34:22 | amaajemyfren | set | pull_requests: + pull_request18284 |
| 2020-03-11 16:24:06 | amaajemyfren | set | pull_requests: + pull_request18282 |
| 2020-03-11 16:08:09 | amaajemyfren | set | pull_requests: + pull_request18281 |
| 2020-03-11 14:59:05 | amaajemyfren | set | keywords:
+ patch stage: patch review pull_requests: + pull_request18278 |
| 2020-02-29 13:04:26 | amaajemyfren | create | |
