Exhausted authority preactivation teardown stays running and cannot be recovered
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
Start in src/kdive/services/systems/authority_owned.py around enqueue_preactivation_teardown, where a prior job is returned unless its state is FAILED, and in src/kdive/jobs/worker.py _finalize_handler, which leaves a marked teardown in running without a terminal receipt. Read the reconciler and the runbook sections in docs/operating/runbooks/live-testing.md before choosing where the exhausted state becomes terminal. Done means a test drives a teardown to max_attempts without a receipt and then recovers it once the authority is healthy, and the runbook Limits section states the bounded behaviour.
Written by the indexing model from the issue text.
Description
Problem
When an authority-owned System's preactivation teardown uses up its attempts without a terminal receipt, nothing can recover it. The teardown job stays running with attempt equal to max_attempts (3) and a lapsed lease. No path terminalizes it:
systems.teardownandops.force_teardownreturn the same job;jobs.cancelrefuses it;ops.force_releaseis fenced;- the dedup only recycles a
failedrow, and this row never becomesfailed.
Fixing the underlying cause afterwards does not help, because no new attempt is ever scheduled. The System and its Allocation stay stranded.
Observed in live cells C1 and C2 of #3584. The Exhausted authority System provision runbook also implies that the teardown retries forever, which is not true.
Evidence
src/kdive/services/systems/authority_owned.py:275-286:enqueue_preactivation_teardownreturns a prior job as-is whenprior.state is not JobState.FAILED(if prior is not None and prior.state is not JobState.FAILED: job = prior). Only afailedrow is recycled.src/kdive/jobs/worker.py:535-549: in_finalize_handler, a job that carries an authority System marker and fails without a terminal receipt is logged (marked authority System job %s failed without a terminal receipt) and the method returnsFalse. The job row is not failed, so it staysrunning.src/kdive/mcp/tools/jobs.py:301-312:jobs.cancelrefuses the job with reasonauthority_system_preactivation_teardown_not_cancelable.docs/operating/runbooks/live-testing.md:484-487(from PR #3611): "After its last attempt, nothing restarts it.systems.teardownandops.force_teardownreturn the same job, andjobs.cancelrefuses it".- No reconciler path terminalizes an exhausted marked teardown that has no receipt. The provision job has such a path (the reconciler cancels it once the teardown supersedes it,
live-testing.md:504-508), but the teardown itself does not. docs/operating/runbooks/exhausted-authority-system-provision.md:46-49, "Limits": "Restore the authority service and let the teardown retry." This implies unbounded retry and does not mention themax_attemptsstop.
Expected
- Once the cause is fixed, an operator can recover an exhausted preactivation teardown through a supported path. Examples: the teardown is moved to
failedso the existing operator recycle (#3530 policy) admits it, or an admin re-arm. No lab rollback is needed, and no manual row edits. - The runbook's "Limits" section states the
max_attemptsstop and links to the #3611 subsection, Recovering an allocation stranded by a failed authority-owned provision.
Proposed approach
- Choose where the exhausted state becomes terminal. Two candidates:
- the reconciler fails a marked preactivation teardown whose
attempt == max_attemptsand whose lease has lapsed with no receipt; - the operator recycle in
enqueue_preactivation_teardownadmits that row as well asfailed.
Either way, keep the invariant that release stays fenced until the authority's absence receipt exists. Record the decision as an amendment if it changes the teardown state machine of an accepted ADR.
- the reconciler fails a marked preactivation teardown whose
- Add tests that drive a teardown to exhaustion without a receipt and then recover it once the authority is healthy.
- Docs fix, in the same PR: in
exhausted-authority-system-provision.md"Limits", replace "let the teardown retry" with the bounded behaviour (three attempts, then the recovery path) and link to the #3611 subsection.
Related: the binding-mismatch dead end filed alongside this issue. That case cannot be recovered by fixing the cause and needs its own exit.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 9h 13m
- Merged PRs (30d)
- 197
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from randomparity/kdive
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
randomparity/kdive#3620 ·
Maintainers usually reply within 1 day
-
area:providers effort:S priority:P3 risk:night-watch status:ready type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
randomparity/kdive#3618 ·
Maintainers usually reply within 1 day
-
area:core-platform effort:S priority:P3 risk:night-safe status:ready type:test
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
randomparity/kdive#3603 ·
Maintainers usually reply within 1 day
-
area:providers effort:S priority:P3 risk:night-safe status:ready type:docs
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
randomparity/kdive#3593 ·
Maintainers usually reply within 1 day
-
area:providers effort:S priority:P3 risk:night-safe status:ready type:refactor
Difficulty 1/5 Under an hour Newbie friendliness 84/100
randomparity/kdive#3592 ·
Maintainers usually reply within 1 day
All issues in randomparity/kdive
Similar issues
-
fleet size/m
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sipyourdrink-ltd/bernstein#7548 ·
Maintainers usually reply within 1 day
-
good first issue help wanted level 1 wocs
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
GianlucaBave/murmury#73 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
G-nn-r/lg_heatpump#52 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
agno-agi/agno#11657 · 1 comment ·
Maintainers usually reply within 1 day
-
category:codebase:gpi category:codebase:handle type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day