Skip to content

Inconsistent HPA lifecycle and race conditions in ScaledObject pause handling #7663

Description

@rickbrouwer

The paused-replicas annotation has inconsistent behavior compared to paused.

When paused=true is set, the HPA is deleted and the scale loop is stopped.
When paused-replicas=<number> is set, the HPA is first deleted but then recreated with min=max=N, and the scale loop is restarted. This causes:

  • Both, the HPA and the scale executor trying to scale to N simultaneously
  • A conflict at paused-replicas=0 where the HPA is created with min=max=1 instead of the intended 0 replicas
  • Switching from paused-replicas to paused leaves a stale HPA and scale loop behind
  • Errors in replica count verification are silently swallowed

Additionally, the ScaledJob pause flow does not use the status-first pattern and only stops the scale loop on the first pause, not idempotently on every reconcile.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Ready To Ship

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions