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

Resolve race condition in interruptibleMany after interruption #3074

Merged
merged 2 commits into from
Jul 9, 2022

Conversation

djspiewak
Copy link
Member

The race condition here is that the busy-loop which spams interruption on the worker thread can continue to run after the interruption has been caught and handled. That… actually literally the point. This is problematic though because it means the worker thread will be returned to the pool in an interrupted state, which in turn shuts down the pool. The solution is to busy-wait (we can't hard-block because that would, itself, be interrupted) until the interruption loop is finished, and then finally clear the interrupted bit at the very end.

Fixes #3073

@djspiewak
Copy link
Member Author

Released as 3.3.13-7-ea6f370.

I've run this on the reproducer several times and it appears to be fixed!

@durban durban mentioned this pull request Jul 7, 2022
Copy link
Member

@armanbilge armanbilge left a comment

Choose a reason for hiding this comment

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

Sadly I don't understand everything about how this works. But these changes make sense AFAICT.

@armanbilge armanbilge merged commit eacb835 into typelevel:series/3.3.x Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants