Skip to content

fix(#555): add activeDeadlineSeconds to the auto-upgrade Job - #620

Merged
divyasinghds merged 3 commits into
developfrom
fix/555-auto-upgrade-deadline
Aug 7, 2026
Merged

fix(#555): add activeDeadlineSeconds to the auto-upgrade Job#620
divyasinghds merged 3 commits into
developfrom
fix/555-auto-upgrade-deadline

Conversation

@divyasinghds

@divyasinghdsdivyasinghds commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Closes#555.

Fix

Add activeDeadlineSeconds to the auto-upgrade Job spec (new autoUpgrade.activeDeadlineSeconds, default 900) so a hung helm repo update can no longer run unbounded.

Files

  • client/templates/auto-upgrade-cronjob.yaml, client/values.yaml, client/values.schema.json

Validation

helm template, schema JSON valid.

🤖 Generated with Claude Code


Note

Medium Risk
Changes only the auto-upgrade CronJob lifecycle timing on fleet edges; logic is designed not to kill in-flight upgrades before helm upgrade --wait times out, but mis-tuned deadlines could still fail long upgrades.

Overview
Fixes #555 by giving the auto-upgrade CronJob Job a hard wall-clock limit so a stuck helm repo add / helm repo update cannot block every future run under concurrencyPolicy: Forbid.

The Job now sets activeDeadlineSeconds to max(autoUpgrade.activeDeadlineSeconds, parsed timeout + 300s), with a new configurable floor (default 900s) and a tracebloc.durationSeconds helper that turns autoUpgrade.timeout (e.g. 10m) into seconds. Chart version bumps to 1.9.24; values and JSON schema document the new knob.

Reviewed by Cursor Bugbot for commit a362b76. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment threadclient/templates/auto-upgrade-cronjob.yaml Outdated
Comment threadclient/templates/auto-upgrade-cronjob.yaml Outdated
Comment threadclient/Chart.yaml Outdated
@divyasinghds
divyasinghdsforce-pushed the fix/555-auto-upgrade-deadline branch from 40071a2 to e7f51c5CompareAugust 6, 2026 11:03

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e7f51c5. Configure here.

Comment threadclient/templates/auto-upgrade-cronjob.yaml Outdated
@shujaatTraceblocshujaatTracebloc added pii-gate-override Bypass the public PII gate (reviewed false positive or gate cannot run); visible in audit and removed pii-gate-override Bypass the public PII gate (reviewed false positive or gate cannot run); visible in audit labels Aug 6, 2026
shujaatTracebloc
shujaatTracebloc previously approved these changes Aug 6, 2026

@shujaatTraceblocshujaatTracebloc 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.

Reviewed the code: LGTM.

  • New tracebloc.durationSeconds helper parses Go/Helm duration strings (sums <int><unit> components, handles compound like 1h30m, empty→0) — correct.
  • activeDeadlineSeconds: max($deadlineFloor, parsed timeout + 300s) never undercuts a longer configured autoUpgrade.timeout, so a healthy helm upgrade --wait can't be killed early; the 900s floor backstops a hung helm repo add/update under concurrencyPolicy: Forbid. Sound.
  • schema + values.yaml wire the new knob (integer, min 1, default 900); Chart bumped 1.9.21→1.9.22. No unresolved Bugbot/review threads.

All checks green except the org-wide pii-gate (PII_DENYLIST secret unset, backend#1409) — a known infra false-positive tracked separately, not a concern in this diff. Satisfies #555.

divyasinghdsand others added 3 commits August 7, 2026 11:49
autoUpgrade.timeout ("10m") bounds only `helm upgrade --wait`, not the
earlier `helm repo add`/`helm repo update` HTTPS fetches. On a TCP black-hole
(a corporate proxy that drops packets with no RST) those fetches can hang
with no hard timeout; with concurrencyPolicy: Forbid the hung Job then makes
every future scheduled tick "still active" and skipped, wedging auto-upgrade
until a human kills the pod.
Add activeDeadlineSeconds (new autoUpgrade.activeDeadlineSeconds knob,
default 900s) to the Job spec as a hard wall-clock backstop, mirroring
storage-assertions-check.yaml. Kept comfortably above the 600s helm timeout
plus repo-update headroom so a slow-but-healthy upgrade is never killed
mid-flight. Also declared in values.schema.json alongside the sibling knobs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump chart version 1.9.21 -> 1.9.22 so the chart-content change can be
published (CI gate), and keep appVersion in lockstep with version
("1.9.22") per the repo convention — the previous divergence was the
Bugbot finding.
Default autoUpgrade.activeDeadlineSeconds to 900 in the CronJob template
so a --reuse-values upgrade that omits the new key still renders a valid
integer instead of an empty/invalid value.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bugbot: the fixed default activeDeadlineSeconds (900s) could kill a
healthy `helm upgrade --wait` when autoUpgrade.timeout was configured
longer (e.g. 30m), firing before helm's own timeout.
Render activeDeadlineSeconds as max(configured floor, parsed timeout +
300s repo-fetch headroom) via a new tracebloc.durationSeconds helper.
The 300s mirrors the baked-in 900-600 default headroom, so the default
case is a no-op (900) and the `| default 900` reuse-values nil-guard is
preserved.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@shujaatTraceblocshujaatTracebloc 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. Correctly caps the auto-upgrade Job's wall-clock time to unwedge the Forbid concurrency policy when a helm repo fetch hangs (#555).

  • activeDeadlineSeconds: max(floor, parsed timeout + 300s) correctly never undercuts a longer configured autoUpgrade.timeout, so a healthy helm upgrade --wait won't be killed early.
  • New tracebloc.durationSeconds helper parses compound durations and nil-guards to 0.
  • Chart bumped 1.9.23 → 1.9.24; schema + values documented.
  • All CI green incl. Fleet auto-upgrade E2E (k3d); Cursor Bugbot clean.

@divyasinghds
divyasinghds merged commit 3c8896c into developAug 7, 2026
21 checks passed
@LukasWodka
LukasWodka deleted the fix/555-auto-upgrade-deadline branch August 14, 2026 14:18
Sign up for freeto 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.

auto-upgrade CronJob lacks activeDeadlineSeconds; a hung helm repo update + Forbid skips all future ticks

3 participants

@divyasinghds@shujaatTracebloc@LukasWodka