Skip to content

fix(executor): the runner re-reads its projected attempt token per request, so a task can run past an hour (#1449) - #1451

Merged
athvin merged 1 commit into
mainfrom
fix/1449-attempt-token-reread
Nov 29, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/1449-attempt-token-reread

Conversation

@athvin

@athvin athvin commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #1449

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

exec-task's channel holds a Credential, either a static env token or a file path, and re-reads the projected token file on every request. It no longer caches the token read at startup.

Why

No task could run past an hour. The task template projects a ServiceAccount token with expirationSeconds: 3600. Kubelet rotates the file, but the runner kept presenting the original, so from the 60-minute mark every heartbeat was refused, the runner fenced itself, and the reaper killed it (exit 137). #558's 10M ingest lost tries 2 and 3 this way: both sent their last heartbeat about 60 minutes in (try 3: 15:12:34 → 16:12:39).

Proof

make check exit 0. Unit test a_file_credential_presents_the_rotated_token: a rewritten file is the token presented next, and a vanished file is a request error. The end-to-end proof is #558's rerun, which needs ingest past an hour: it's in this ledger.

Risk & rollback

One file read per channel request (a heartbeat every 30 s). Startup still reads once, so a missing volume fails immediately. Rollback: git revert <merge-sha> (hour-plus tasks die again).

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on brians-MacBook-Pro · 2026-11-29T17:07:39Z

Specific to this change

  • a task runs past an hour on er-dev — 10M-scale spill run without eviction #558 rerun job 01a22845…: ingest try 2 started 17:07:48Z and heartbeated at 18:12:52Z (65m04s), past the 60-minute mark where the token-cached runner died twice before (15:12:34 → 16:12:39, killed).
Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

🤖 Generated with Claude Code

…quest, so a task can run past an hour (#1449)

The task template projects a ServiceAccount token with
expirationSeconds: 3600 and points ER_ATTEMPT_TOKEN_FILE at it.
exec_task read the file once at startup. Kubelet rotates the file before
expiry, but the runner kept presenting the original, so from the
60-minute mark every heartbeat was refused. The runner fenced itself,
and the reaper killed the pod with exit 137 ('no heartbeat for 5
minutes'). No task could outlive an hour, and a retry repeated the same
death. Found by #558's 10M ingest: tries 2 and 3 each sent their last
heartbeat 60m05s after starting.

The channel now holds a Credential, either a static env token or a file
path, and reads the file on every request. Startup still reads it once,
so a missing volume fails immediately. The heartbeat thread and the
DuckFleet journal clone the credential rather than a token string.

Unit test a_file_credential_presents_the_rotated_token: a rewritten file
is the token presented next, and a vanished file is a request error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin merged commit b328929 into main Nov 29, 2026
40 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 29, 2026 16:46 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — dd2af435 Deployed Nov 29, 2026 by athvin via remove closed PR previews #173
Sign up for free to 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.

fix(executor): any task over an hour is killed — the runner reads its projected attempt token once, and it expires at 3600 s

2 participants