Repository navigation
fix(pool): recover subpool workers after runtime.Goexit - #148
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #148 +/- ##
==========================================
+ Coverage 95.75% 95.80% +0.04%
==========================================
Files 11 11
Lines 613 620 +7
==========================================
+ Hits 587 594 +7
Misses 23 23
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alitto
approved these changes
Oct 17, 2026
alitto
left a comment
Owner
There was a problem hiding this comment.
Nice contribution 🙌 , thanks a lot!
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.
A task that calls
runtime.Goexit()skipssubpoolWorker's queue handoff and worker bookkeeping. Its subpool retains a worker that no longer exists, so queued tasks never run andStopAndWait()blocks indefinitely. Nested subpools are affected as well.Mirror the root worker's abnormal-exit cleanup in subpool workers: record the failed task, retire the worker when there is no queued work, or launch its replacement. The regression covers direct and nested subpools, subsequent task completion, shutdown and task counters.
Related to #135 and #137.
Validation (Go 1.26.9, macOS):
7b7c16afor both subpool layouts.-race -count=10.make test-cipasses (go test -race -v -timeout 1m -count=3 ./...).go vet ./...andgit diff --checkpass.