Skip to content

Conversation

@rickbrouwer
Copy link
Member

@rickbrouwer rickbrouwer commented Nov 11, 2025

When a ScaledObject is scaled to zero and the scaler encounters an error, the fallback mechanism is only triggered during HPA metric requests via GetScaledObjectMetrics, but not during the polling loop in getScaledObjectState. This caused the ScaledObject to remain at zero replicas indefinitely when errors occurred, as the polling loop would continuously fail without activating the fallback, preventing HPA from ever being consulted.

Fallback now works in both, HPA requests and polling interval checks.

The only question I have is whether it's by design that it doesn't switch to Fallback with 0 replicas, but I can't think of that myself. Please consider this when considering whether this was a deliberate choice. If not, I believe this PR resolves the issue.

Some extra new info;

It turned out to be a more change than I anticipated. I initially thought I'd add a simple fallback to getScalerState, but it turned out that scalingModifiers started having issues.
Therefore, I had to make some further adjustments to ensure the fallback worked properly from all positions.

Checklist

Fixes #7239

@rickbrouwer rickbrouwer requested a review from a team as a code owner November 11, 2025 09:22
@github-actions
Copy link

Thank you for your contribution! 🙏

Please understand that we will do our best to review your PR and give you feedback as soon as possible, but please bear with us if it takes a little longer as expected.

While you are waiting, make sure to:

  • Add an entry in our changelog in alphabetical order and link related issue
  • Update the documentation, if needed
  • Add unit & e2e tests for your changes
  • GitHub checks are passing
  • Is the DCO check failing? Here is how you can fix DCO issues

Once the initial tests are successful, a KEDA member will ensure that the e2e tests are run. Once the e2e tests have been successfully completed, the PR may be merged at a later date. Please be patient.

Learn more about our contribution guide.

@keda-automation keda-automation requested a review from a team November 11, 2025 09:22
@snyk-io
Copy link

snyk-io bot commented Nov 11, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 11, 2025

/run-e2e internals
Update: You can check the progress here

@rickbrouwer rickbrouwer marked this pull request as draft November 11, 2025 12:32
@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 12, 2025

/run-e2e internals
Update: You can check the progress here

@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 12, 2025

/run-e2e internals
Update: You can check the progress here

Signed-off-by: Rick Brouwer <[email protected]>
@rickbrouwer rickbrouwer marked this pull request as ready for review November 12, 2025 15:11
@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 12, 2025

/run-e2e internals
Update: You can check the progress here

@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 12, 2025

/run-e2e internals
Update: You can check the progress here

@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 18, 2025

/run-e2e internals
Update: You can check the progress here

Signed-off-by: Rick Brouwer <[email protected]>
@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 19, 2025

/run-e2e internals
Update: You can check the progress here

@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 19, 2025

/run-e2e internals
Update: You can check the progress here

@rickbrouwer
Copy link
Member Author

rickbrouwer commented Nov 23, 2025

/run-e2e internals
Update: You can check the progress here

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.

KEDA fallback does not scale from 0 to 1 when metrics cannot be fetched and minReplicaCount is 0

1 participant