Repository navigation
Conversation
…numpy#33570) Signed-off-by: Iason Krommydas <iason.krom@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #33570.
PR summary
Follow-up to #33551.
This is not critical as my understanding is that these hangs can happen only if an error is raised inside a worker somehow. But it's good to be protected against such a thing.
Some of our threaded tests hang instead of failing when a worker raises or a thread fails to start, because the other workers stay stuck at a barrier or event forever.
run_threadednow aborts the barrier as soon as a worker raises and reports the original exception, not theBrokenBarrierErrorit causes in the other workers.test_printoptions_thread_safetyandtest_thread_safe_argparse_cachenow userun_threadedinstead of raw threads.test_arg_lockingstops the mutator with an event once the readers are done instead of using a shared counter,test_thread_localitysets its event in afinally, and the writer intest_read_write_bool_arrayreleases the reader if it fails.AI Disclosure
I worked on this with an AI model AI and an AI model was used to find these hangs by Nathan.