Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.12] gh-109047: concurrent.futures catches RuntimeError (#109810)#110126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Yhg1s merged 1 commit intopython:3.12fromvstinner:cf_finalization_error12
Oct 2, 2023

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedSep 29, 2023
edited by bedevere-appbot
Loading

concurrent.futures: Theexecutor manager thread now catches exceptions when adding an item to thecall queue. During Python finalization, creating a new thread can now raise RuntimeError. Catch the exception and call terminate_broken() in this case.

Add test_python_finalization_error() to test_concurrent_futures.

concurrent.futures._ExecutorManagerThread changes:

  • terminate_broken() no longer calls shutdown_workers() since the call queue is no longer working anymore (read and write ends of the queue pipe are closed).
  • terminate_broken() now terminates child processes, not only wait until they complete.
  • _ExecutorManagerThread.terminate_broken() now holds shutdown_lock to prevent race conditons with ProcessPoolExecutor.submit().

multiprocessing.Queue changes:

  • Add _terminate_broken() method.
  • _start_thread() sets _thread to None on exception to prevent leaking "dangling threads" even if the thread was not started yet.

(cherry picked from commit6351842)

…ython#109810)concurrent.futures: The *executor manager thread* now catchesexceptions when adding an item to the *call queue*. During Pythonfinalization, creating a new thread can now raise RuntimeError. Catchthe exception and call terminate_broken() in this case.Add test_python_finalization_error() to test_concurrent_futures.concurrent.futures._ExecutorManagerThread changes:* terminate_broken() no longer calls shutdown_workers() since the  call queue is no longer working anymore (read and write ends of  the queue pipe are closed).* terminate_broken() now terminates child processes, not only  wait until they complete.* _ExecutorManagerThread.terminate_broken() now holds shutdown_lock  to prevent race conditons with ProcessPoolExecutor.submit().multiprocessing.Queue changes:* Add _terminate_broken() method.* _start_thread() sets _thread to None on exception to prevent  leaking "dangling threads" even if the thread was not started  yet.(cherry picked from commit6351842)
@vstinnervstinner changed the titlegh-109047: concurrent.futures catches PythonFinalizationError (#109810)[3.12] gh-109047: concurrent.futures catches RuntimeError (#109810)Sep 29, 2023
@rhettingerrhettinger removed their request for reviewSeptember 30, 2023 17:32
@Yhg1sYhg1s merged commit356de02 intopython:3.12Oct 2, 2023
@vstinnervstinner deleted the cf_finalization_error12 branchJanuary 14, 2025 08:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@vstinner@Yhg1s

[8]ページ先頭

©2009-2025 Movatter.jp