Skip to content

Reset busy counters after triggering an auto-scale-up decision - #17538

Merged
normanmaurer merged 1 commit into
4.2from
busy_reset
Sep 19, 2026
Merged

normanmaurer merged 1 commit into
4.2from
busy_reset

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

AutoScalingEventExecutorChooserFactory suspends idle executors and
resets their busy/idle cycle counters once a scale-down decision is
made, so they need a fresh patience period before triggering another
scaling decision. The scale-up path had no equivalent reset: once an
executor's busy-cycle counter crossed scalingPatienceCycles, it kept
incrementing on every following cycle it remained busy, so the same
executor could keep triggering further scale-ups on its own without
any additional executor becoming busy. This causes the group to
overshoot the number of active executors that the actual load
justifies, and is the cause of intermittent CI failures in
AutoScalingEventExecutorChooserFactoryTest.testScaleUp (e.g. expected
2 active executors but found 3).

Modifications:

  • Track the executors that are consistently busy in a list, mirroring
    the existing consistentlyIdleChildren list, instead of only counting
    them.
  • After using that list to decide on a scale-up, reset the busy and
    idle cycle counters of the contributing executors so each one needs
    another full patience period of sustained load before it can justify
    a further scale-up.

Result:

A single sustained busy executor scales the group up exactly once per
patience period instead of repeatedly ramping up on its own.

Motivation:

AutoScalingEventExecutorChooserFactory suspends idle executors and
resets their busy/idle cycle counters once a scale-down decision is
made, so they need a fresh patience period before triggering another
scaling decision. The scale-up path had no equivalent reset: once an
executor's busy-cycle counter crossed scalingPatienceCycles, it kept
incrementing on every following cycle it remained busy, so the same
executor could keep triggering further scale-ups on its own without
any additional executor becoming busy. This causes the group to
overshoot the number of active executors that the actual load
justifies, and is the cause of intermittent CI failures in
AutoScalingEventExecutorChooserFactoryTest.testScaleUp (e.g. expected
2 active executors but found 3).

Modifications:

- Track the executors that are consistently busy in a list, mirroring
  the existing consistentlyIdleChildren list, instead of only counting
  them.
- After using that list to decide on a scale-up, reset the busy and
  idle cycle counters of the contributing executors so each one needs
  another full patience period of sustained load before it can justify
  a further scale-up.

Result:

A single sustained busy executor scales the group up exactly once per
patience period instead of repeatedly ramping up on its own.
@normanmaurer normanmaurer added this to the 4.2.19.Final milestone Sep 18, 2026
@normanmaurer normanmaurer added the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 18, 2026

@franz1981 franz1981 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lgtm @isaacrivriv WDYT?

@isaacrivriv isaacrivriv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense to me, not sure how that was missed for the consistentlyBusyChildren but done for the consistentlyIdleChildren so a similar logic to handle the same issues make sense.

@isaacrivriv

Copy link
Copy Markdown
Contributor

Also this reminds me I have a couple of PRs that I had open almost a year ago relating to the auto scaling work😅
#15797
#15813
any chance we could revisit those to merge them in? I can go ahead and update them as necessary to clean them up since it's been a while...

@normanmaurer

Copy link
Copy Markdown
Member Author

@isaacrivriv yes sure.

@testlens-app

testlens-app Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 25c8c2c
▶️ Tests: 42877 executed
⚪️ Checks: 29/29 completed


Learn more about TestLens at testlens.app/docs.

@normanmaurer
normanmaurer merged commit 8af38d1 into 4.2 Sep 19, 2026
44 of 45 checks passed
@normanmaurer
normanmaurer deleted the busy_reset branch September 19, 2026 14:57
@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port PR for 5.0: #17547

@github-actions github-actions Bot removed the needs-cherry-pick-5.0 This PR should be cherry-picked to 5.0 once merged. label Sep 19, 2026
normanmaurer added a commit that referenced this pull request Sep 20, 2026
…decision (#17547)

Auto-port of #17538 to 5.0
Cherry-picked commit: 8af38d1

---
Motivation:

AutoScalingEventExecutorChooserFactory suspends idle executors and
resets their busy/idle cycle counters once a scale-down decision is
made, so they need a fresh patience period before triggering another
scaling decision. The scale-up path had no equivalent reset: once an
executor's busy-cycle counter crossed scalingPatienceCycles, it kept
incrementing on every following cycle it remained busy, so the same
executor could keep triggering further scale-ups on its own without
any additional executor becoming busy. This causes the group to
overshoot the number of active executors that the actual load
justifies, and is the cause of intermittent CI failures in
AutoScalingEventExecutorChooserFactoryTest.testScaleUp (e.g. expected
2 active executors but found 3).

Modifications:

- Track the executors that are consistently busy in a list, mirroring
  the existing consistentlyIdleChildren list, instead of only counting
  them.
- After using that list to decide on a scale-up, reset the busy and
  idle cycle counters of the contributing executors so each one needs
  another full patience period of sustained load before it can justify
  a further scale-up.

Result:

A single sustained busy executor scales the group up exactly once per
patience period instead of repeatedly ramping up on its own.

Co-authored-by: Norman Maurer <[email protected]>
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.

4 participants