Issue31238
Created on 2017-08-18 23:50 by vstinner, last changed 2018-06-01 17:39 by vstinner. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 3151 | merged | vstinner, 2017-08-18 23:51 | |
| PR 3177 | closed | vstinner, 2017-08-22 09:57 | |
| PR 7324 | merged | vstinner, 2018-06-01 16:07 | |
| Messages (5) | |||
|---|---|---|---|
| msg300556 - (view) | Author: STINNER Victor (vstinner) * | Date: 2017-08-18 23:50 | |
When using https://github.com/python/cpython/pull/3138 I see that test_pydoc leaves a dangling thread. The bug comes from test_server() which uses pydoc ServerThread. ServerThread.stop() and test_pydoc don't join the thread. Moreover, ServerThread.docserver has a reference cycle through the DocServer.callback attribute. Attached PR modifies ServerThread.stop() to join itself (the thread), to wait until the HTTP server completes, and then explicitly break the reference cycle. With the PR, pydoc may hang if a bad HTTP client. So another option is to only modify test_pydoc to join() + break the ref cycle. |
|||
| msg300557 - (view) | Author: STINNER Victor (vstinner) * | Date: 2017-08-18 23:52 | |
This issue is similar to bpo-31151: socketserver ForkingMixIn.server_close() leaks zombie processes. |
|||
| msg300652 - (view) | Author: STINNER Victor (vstinner) * | Date: 2017-08-21 21:24 | |
New changeset 4cab2cd0c05fcda5fcb128c9eb230253fff88c21 by Victor Stinner in branch 'master': bpo-31238: pydoc ServerThread.stop() now joins itself (#3151) https://github.com/python/cpython/commit/4cab2cd0c05fcda5fcb128c9eb230253fff88c21 |
|||
| msg300701 - (view) | Author: STINNER Victor (vstinner) * | Date: 2017-08-22 14:57 | |
I left Python 2.7 and 3.6 unchanged to focus on fixing dangling threads and other similar bugs in the master branch first. I will see later if we really need to backport the fix to stable branches. In the meanwhile, I close the issue. |
|||
| msg318439 - (view) | Author: STINNER Victor (vstinner) * | Date: 2018-06-01 17:39 | |
New changeset f3297433e309e9591eaa3f36e1d7887e9d0620d7 by Victor Stinner in branch '3.6': bpo-31238: pydoc ServerThread.stop() now joins itself (GH-3151) (GH-7324) https://github.com/python/cpython/commit/f3297433e309e9591eaa3f36e1d7887e9d0620d7 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2018-06-01 17:39:19 | vstinner | set | messages: + msg318439 |
| 2018-06-01 16:07:41 | vstinner | set | pull_requests: + pull_request6953 |
| 2017-08-22 14:57:00 | vstinner | set | messages: + msg300701 |
| 2017-08-22 14:55:52 | vstinner | set | status: open -> closed resolution: fixed stage: resolved |
| 2017-08-22 09:57:15 | vstinner | set | pull_requests: + pull_request3215 |
| 2017-08-21 21:24:42 | vstinner | set | messages: + msg300652 |
| 2017-08-21 17:37:33 | serhiy.storchaka | set | nosy:
+ pitrou |
| 2017-08-18 23:52:39 | vstinner | set | messages: + msg300557 |
| 2017-08-18 23:51:09 | vstinner | set | pull_requests: + pull_request3185 |
| 2017-08-18 23:50:45 | vstinner | create | |