Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocked thread detection fixes #4195

Merged

Conversation

biochimia
Copy link
Contributor

There are two small things here, both related to the blocked thread detection code:

  • it was using the original thread index to check for itself, while the index will be updated after the thread converts to blocking. The fix here is to rely on the updated index, instead;
  • when randomly picking another thread, it would include itself in the pool, and then pick again in case it picked itself. In this case the random choice was changed to exclude self from the choice pool.

The direct use of `idx` was inappropriate, as it doesn't get updated if
the worker switches to blocking mode, and is later recovered as a
different worker thread.
When checking for a blocked thread, randomly pick a thread other than
self at once, rather than checking after the fact.
@biochimia biochimia force-pushed the blocked-thread-detection-fixes branch from 4bc33c2 to 189e412 Compare December 10, 2024 14:27
Copy link
Member

@djspiewak djspiewak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice cleanup

@djspiewak djspiewak merged commit 4afa4e3 into typelevel:series/3.x Dec 10, 2024
29 of 33 checks passed
@biochimia biochimia deleted the blocked-thread-detection-fixes branch December 11, 2024 11:04
@armanbilge armanbilge changed the title (Minor) Blocked thread detection fixes Blocked thread detection fixes Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants