Skip to content

fix(pool): recover subpool workers after runtime.Goexit - #148

Merged
alitto merged 1 commit into
alitto:mainfrom
zhechen-cs:codex/subpool-goexit
Oct 17, 2026
Merged

alitto merged 1 commit into
alitto:mainfrom
zhechen-cs:codex/subpool-goexit

Conversation

@zhechen-cs

Copy link
Copy Markdown
Contributor

A task that calls runtime.Goexit() skips subpoolWorker's queue handoff and worker bookkeeping. Its subpool retains a worker that no longer exists, so queued tasks never run and StopAndWait() 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):

  • Regression fails on unmodified 7b7c16a for both subpool layouts.
  • New regression and existing Goexit tests pass with -race -count=10.
  • make test-ci passes (go test -race -v -timeout 1m -count=3 ./...).
  • go vet ./... and git diff --check pass.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.80%. Comparing base (7b7c16a) to head (da86f92).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alitto alitto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Nice contribution 🙌 , thanks a lot!

@alitto
alitto merged commit 17ae9fb into alitto:main Oct 17, 2026
18 checks passed
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