Skip to content

fix(pool): account for active workers when resizing - #146

Merged
alitto merged 1 commit into
alitto:mainfrom
bensynapse:fix-resize-worker-capacity
Oct 3, 2026
Merged

alitto merged 1 commit into
alitto:mainfrom
bensynapse:fix-resize-worker-capacity

Conversation

@bensynapse

Copy link
Copy Markdown
Contributor

I run Live Tennis API.

Resizing uses the previous concurrency limit to decide how many workers to start. Existing workers can still exceed that limit after a shrink. Raising it again then starts surplus workers that immediately retire. In a subpool with a full parent, those submissions can block Resize until running tasks finish.

Calculate available capacity from the current worker count under the existing mutex. The tests cover repeated resizing, partial retirement and growth above the original limit, for pools and subpools. A separate test checks that resizing returns while the parent is full.

Five regression cases fail against upstream. All seven new cases pass across 50 runs with the race detector. make test-ci passes on Go 1.25.8. make coverage passes on Go 1.21.13. go build ./..., go vet ./... and formatting checks pass.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.75%. Comparing base (e309c37) to head (c27ea03).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   95.74%   95.75%   +0.01%     
==========================================
  Files          11       11              
  Lines         611      613       +2     
==========================================
+ Hits          585      587       +2     
  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!

@alitto alitto added the good first issue Good for newcomers label Oct 3, 2026
@alitto
alitto merged commit fa2e514 into alitto:main Oct 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants