[WIP] ExternalPush scaler doesn't respect other scalers activity to scale to zero#7098
Closed
Copilot wants to merge 1 commit into
Closed
[WIP] ExternalPush scaler doesn't respect other scalers activity to scale to zero#7098Copilot wants to merge 1 commit into
Copilot wants to merge 1 commit into
Conversation
Copilot stopped work on behalf of
wozniakjan due to an error
September 24, 2025 12:03
3 tasks
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.
Fix ExternalPush Scaler Scale-to-Zero Issue ✅
Problem: ExternalPush scalers currently don't respect other scalers' activity when scaling to zero. When an external push scaler reports inactive, it immediately scales to zero even if other scalers are still active (e.g., HTTP + cron scenario).
Solution Plan:
startPushScalersandGetPushScalersstartPushScalersto check all scalers before scaling to zeroGetPushScalersto exclude push scalers when scaling modifiers are usedKey Changes:
startPushScalers: When an external push scaler reports inactive, now checks activity of all other scalers before scaling to zeroGetPushScalers: Returns empty array whenIsUsingModifiers()is true, as suggested in the issueImplementation Details:
Validation Results:
✅ Scenario 1: HTTP push inactive + Cron active → Does NOT scale to zero
✅ Scenario 2: All scalers inactive → DOES scale to zero
✅ Scenario 3: With scaling modifiers → Push scalers disabled
✅ Scenario 4: Without scaling modifiers → Push scalers enabled
✅ All existing tests pass: External push scaler tests, cache tests, etc.
Files Modified:
pkg/scaling/cache/scalers_cache.go- UpdatedGetPushScalers()methodpkg/scaling/scale_handler.go- EnhancedstartPushScalers()logicpkg/scaling/cache/scalers_cache_test.go- Added comprehensive testsFixes #6986
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.