You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a Running Sandbox with the AutoPauseController feature gate enabled, updating an existing named exec probe can leave the controller evaluating the old Pod condition in the same reconcile. EnsureProbe patches the Pod's kruise.io/podprobe annotation for the new spec.probes value, but then immediately mirrors the already-read Pod.Status.Conditions into Sandbox.Status.Conditions. Conditions are selected by probe name, with no configuration generation/version check.
If the old Active probe had reported True with message idle, and the probe is updated in the same spec patch to run printf active, an accompanying policy with probe: Active, messageRegex: ^idle$, and thresholdDuration: 0 can make the same reconcile call handleAutoPause with the stale idle result. The Sandbox can therefore be paused before the new probe configuration has produced a result.
This is a static code-path counterexample from the baseline source; it has not been reproduced on a live cluster.
What you expected to happen:
After a named probe's configuration changes, AutoPause should wait for a result produced by the new configuration. It should not treat a condition produced by the previous command as evidence that the updated probe is idle. With thresholdDuration: 0, pausing should be immediate only after the new probe reports a matching idle result.
How to reproduce it (as minimally and precisely as possible):
Use a Running, claimed Sandbox with the AutoPauseController feature gate enabled. Start with an Active exec probe whose command is equivalent to printf idle, and with no pause policy so the old result cannot pause the Sandbox before the update.
Wait until the Pod condition for agents.kruise.io/Active is True with message idle.
Apply one Sandbox.spec update that both replaces the same-named probe command with printf active and sets this pause policy:
Related context: found while reviewing #955; the affected code path is already present at the baseline commit above.
The example uses a legal zero threshold. Repository validation explicitly treats zero as “pause as soon as the probe reports idle”; negative thresholds are rejected.
No Kubernetes version, installation details, or live-cluster observation are available for this report.
Environment:
OpenKruiseAgent version: Repository source at commit cb37dce59730f1bf6a9a34fafa3e07c27b906e09 (baseline)
Kubernetes version (use kubectl version): Not reproduced on a live cluster
Install details (e.g. helm install args): Not available
Others: Static source analysis; AutoPauseController feature gate enabled in the reproduction scenario
What happened:
On a Running Sandbox with the
AutoPauseControllerfeature gate enabled, updating an existing named exec probe can leave the controller evaluating the old Pod condition in the same reconcile.EnsureProbepatches the Pod'skruise.io/podprobeannotation for the newspec.probesvalue, but then immediately mirrors the already-readPod.Status.ConditionsintoSandbox.Status.Conditions. Conditions are selected by probe name, with no configuration generation/version check.If the old
Activeprobe had reportedTruewith messageidle, and the probe is updated in the samespecpatch to runprintf active, an accompanying policy withprobe: Active,messageRegex: ^idle$, andthresholdDuration: 0can make the same reconcile callhandleAutoPausewith the staleidleresult. The Sandbox can therefore be paused before the new probe configuration has produced a result.This is a static code-path counterexample from the baseline source; it has not been reproduced on a live cluster.
What you expected to happen:
After a named probe's configuration changes, AutoPause should wait for a result produced by the new configuration. It should not treat a condition produced by the previous command as evidence that the updated probe is idle. With
thresholdDuration: 0, pausing should be immediate only after the new probe reports a matchingidleresult.How to reproduce it (as minimally and precisely as possible):
Use a Running, claimed Sandbox with the
AutoPauseControllerfeature gate enabled. Start with anActiveexec probe whose command is equivalent toprintf idle, and with no pause policy so the old result cannot pause the Sandbox before the update.Wait until the Pod condition for
agents.kruise.io/ActiveisTruewith messageidle.Apply one
Sandbox.specupdate that both replaces the same-named probe command withprintf activeand sets this pause policy:On the first reconcile after this update, before the runtime has emitted the new probe result, the baseline path is:
EnsureProbepatches the Pod annotation, then callssyncConditionson the old in-memory Pod object and finds the oldActive=True/idlecondition;handleAutoPauseevaluates that mirrored condition;calculatePauseTimeadds zero to its oldLastTransitionTimeand considers the pause due;tryPausepatchesspec.paused=true.Relevant baseline source at commit
cb37dce59730f1bf6a9a34fafa3e07c27b906e09:EnsureProbe,syncConditions,handleAutoPause,calculatePauseTime, andtryPause.Anything else we need to know?:
7a16b1562b9eb72681e67099ffa454e475361b05(Sandbox Auto-Pause and Resume, Sandbox Auto-Pause and Resume #612). The affected runtime files are unchanged from the baseline commit above; this report is independent of the current SandboxClaim auto-pause-policy change.Environment:
cb37dce59730f1bf6a9a34fafa3e07c27b906e09(baseline)kubectl version): Not reproduced on a live clusterAutoPauseControllerfeature gate enabled in the reproduction scenario