This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2017-08-18.23:50:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1503100245.68.0.356327779955.issue31238@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-08-18 23:50:45vstinnersetrecipients: + vstinner
2017-08-18 23:50:45vstinnersetmessageid: <1503100245.68.0.356327779955.issue31238@psf.upfronthosting.co.za>
2017-08-18 23:50:45vstinnerlinkissue31238 messages
2017-08-18 23:50:45vstinnercreate