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.

classification
Title: Add thread timeout for loop.shutdown_default_executor
Type: Stage: patch review
Components: Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: aeros, asvetlov, yselivanov
Priority: normal Keywords: patch

Created on 2019-09-24 19:31 by aeros, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 16360 open aeros, 2019-09-24 20:23
Messages (1)
msg353115 - (view) Author: Kyle Stanley (aeros) * (Python committer) Date: 2019-09-24 19:31
Currently, for the recently added coroutine `loop.shutdown_default_executor()`, the executor shutdown can wait indefinitely for the threads to join. Under normal circumstances, waiting on the threads is appropriate, but there should be a timeout duration in the situation that the threads unable to finish joining. 

The motivation for this was based on the comments from Andrew Svetlov and Yury Selivanov in GH-16284.

The original idea from Andrew was to add the timeout duration as a default for a new parameter in `asyncio.run()` and `loop.shutdown_default_executor()`. However, Yury would prefer for this to be defined as a constant instead and not as a parameter for `asyncio.run()` to avoid the creation of an excessive number of parameters to tweak for the user.

I will attach a PR that adds the constant and the parameter for `loop.shutdown_default_executor()`, which will passed as an argument to `thread.join()`.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82448
2019-09-24 20:23:27aerossetkeywords: + patch
stage: patch review
pull_requests: + pull_request15941
2019-09-24 19:31:44aeroscreate