Kill replaced worker processes when interrupted#370
Open
wintonpc wants to merge 5 commits intogrosser:masterfrom
Open
Kill replaced worker processes when interrupted#370wintonpc wants to merge 5 commits intogrosser:masterfrom
wintonpc wants to merge 5 commits intogrosser:masterfrom
Conversation
wintonpc
commented
Apr 13, 2026
| kill_thread = Thread.new do | ||
| pids = options[:mutex].synchronize do | ||
| @to_be_killed.flatten(1).map(&:pid) | ||
| # FUTURE: stop JobFactory from spawning new workers |
Author
There was a problem hiding this comment.
Doing this properly would involve a new Mutex#synchronize around both the "stopped" check and the call to replace_worker, which I'm hesitant to add without understanding the code better.
grosser
reviewed
Apr 13, 2026
grosser
reviewed
Apr 13, 2026
| @@ -0,0 +1,13 @@ | |||
| # frozen_string_literal: true | |||
Owner
There was a problem hiding this comment.
some description here what this is doing/simulating
grosser
reviewed
Apr 13, 2026
Owner
|
no super excited for this ... killed process just continuing could also be seen as a bug |
Author
No problem. As I mentioned, there's a reasonable workaround. I just wanted to submit a best effort fix along with the bug report. |
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.
Related issue: #369
I preserved the existing contract as much as I could, but there's a non-zero risk of breaking code that uses the gem. Given the niche use case and easy work around, I'm not sure the reward outweighs the risk. (Although since parallel just bumped to 2.x, it may be close to an appropriate time for a potentially breaking change.)