Stranded runs.boot leaves its exhausted authority-marked boot job running until jobs.cancel
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
Start with dead_letter_unowned_external_boot_jobs in src/kdive/db/schema/0165_bound_acknowledged_retry_grant.sql and repair_abandoned_jobs in src/kdive/reconciler/repairs/jobs.py to see why an exhausted authority-marked boot job stays running. Then read the ops.recover_stranded_activation settle path and the runbook at docs/operating/runbooks/stranded-activation-recovery.md. Done means the job is ended by the chosen owner, the job_live refusal and runbook step 2 are updated, and the real-database test no longer cancels the job by hand. The owner decision is still open in the thread, so agree on it first.
Written by the indexing model from the issue text.
Description
Problem
A runs.boot that strands a fixed-worker System leaves its exhausted, authority-marked boot job running after its last attempt. The reconciler's dead_letter_unowned_external_boot_jobs skips it while its authority row is allocating or current, so nothing ends the job. settle_stranded_external_boot_activation then refuses job_live until an operator runs jobs.cancel by hand. The stranded-activation recovery (ADR-0816, ops.recover_stranded_activation) therefore has a manual step that the tool and the reconciler both leave to the operator.
Evidence
src/kdive/db/schema/0165_bound_acknowledged_retry_grant.sql:36-(dead_letter_unowned_external_boot_jobs): for a runningbootjob withattempt >= max_attempts, an expired lease and an authority marker, anallocating/currentauthority row reachesCONTINUE WHEN NOT EXISTS (... acknowledged_retry_consumptions ...). Without a consumption row for the claimed attempt the job is skipped and staysrunning. This is the latest definition (git grepfinds no later redefinition).src/kdive/reconciler/repairs/jobs.py(repair_abandoned_jobs): the generic sweep excludes authority-marked jobs by design, so no other lane ends it.- ADR-0816 (settlement): the shape requires "no queued or running authority-marked job"; the function refuses
job_liveotherwise. docs/operating/runbooks/stranded-activation-recovery.md, Recover step 2: documents the manualjobs.cancelwhenattemptequalsmax_attemptsand the lease has lapsed.- Reproduced in the live proof for #3552: settlement refused
job_liveuntil the exhaustedbootjob was cancelled.
Expected
Decide which owner ends the exhausted job for the stranded shape, so the runbook step is not needed:
- the reconciler, when no work remains for it (the authority never acknowledged a mutation and the activation is
preparingwith no ownership row), or ops.recover_stranded_activationsettle, which cancels or fails an exhausted job with a lapsed lease as part of the audited settlement.
Either way the Run is compensated as the existing dead-letter path does, and a job a worker still holds (lease live, or attempts remaining) is never touched.
Proposed approach
Prefer the tool: settle already runs under the System lock with platform_admin and a recorded reason, which is the authority the reconciler lacks for an authority-marked job. Before refusing job_live, end a boot job of the System whose attempt >= max_attempts and whose lease has lapsed (same predicate as the runbook), through the existing job-cancel service, and audit it. Keep refusing job_live for any other live job. Update the runbook step 2 and the job_live refusal row, and extend the real-database arm that currently cancels the job by hand. If the reconciler is chosen instead, the change is a new migration amending the CONTINUE condition for the stranded shape; weigh that against the 0165 bound on acknowledged retries before choosing it.
Provenance
Follow-up from campaign 4c2c8dc9e59d-7f9a87f5-2251-458a-bb30-04fbb2d4b05c, PR #3595.
- 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