Repository navigation
test: cover a runner whose execution claim is lost - #1157
Merged
Merged
Conversation
A manager refuses every checkpoint and lease renewal once the claim a runner holds is gone. The runner retries a refusal only while it is retryable, so a retryable refusal holds the deployment until the lease deadline (4 minutes) and a final one stops it at the first refusal. The lease wrapper's non-retryable renewal branch had no test. Both tests run each case under paused time and assert how long the deployment is held, how many checkpoints are attempted and how many renewals are sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Enclave skipped this draft pull request. It will run automatically when you mark the PR as Ready for review. |
alongubkin
marked this pull request as ready for review
October 20, 2026 12:54
[Low impact] The PR appears safe to merge; the heartbeat test now checks the intended path. SummaryAdds tests for runners whose execution claims are lost. There are no runtime changes.
The previous finding is fully addressed. No new actionable issues were found. Tests were not run during this review. Reviews (2) · Last reviewed commit: "test: drive the lost-claim heartbeat thr..." · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@greptileai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear: ALIEN-1700. Follows #1154.
Why
Once the execution claim a runner holds is gone, the manager refuses every checkpoint and lease renewal under it with
DEPLOYMENT_UPDATE_CLAIM_LOST. The claim cannot come back: an attempt never becomes live again, and an expired or reassigned lease is not renewed for the old session.The runner already handles a final refusal correctly. The checkpoint loops and the lease wrapper retry only
retryableerrors (since #179). So how long a lost claim holds a deployment depends only on the flag the manager sends:LEASE_RENEW_FAILURE_DEADLINE(3 min 30 s). The renewal at 240 s cancels the loop withDEPLOYMENT_LEASE_LOST, so the deployment is held for 4 minutes. This matches the loop that fix: checkpoint a recovered credential retry once per claim #1154 removed one cause of (11:56:33 to 12:00:33).DEPLOYMENT_CHECKPOINT_FAILED(not retryable), and the manager then releases the claim.The control plane is changing the refusal to final. This PR adds no runtime change. It adds tests for the runner behavior that change depends on. Until now, the lease wrapper's branch that cancels on a final renewal refusal had no test.
Tests
Both tests use paused Tokio time and a transport that refuses every checkpoint and renewal with a 409
DEPLOYMENT_UPDATE_CLAIM_LOST. Each runs once with the refusal retryable and once with it final.lost_claim_holds_the_deployment_only_while_the_refusal_is_retryable: a Running heartbeat throughrun_running_refresh_step_loop.DEPLOYMENT_LEASE_LOSTafter exactly 240 s, with 4 renewals and more than one checkpoint attempt.DEPLOYMENT_CHECKPOINT_FAILEDbefore the first renewal, with 1 checkpoint attempt and 0 renewals.lease_wrapper_cancels_at_the_first_final_renewal_refusal:run_with_lease_renewalaround an operation that would outlive the lease.The other runner tests are unchanged. They run in CI; nothing was built locally.
🤖 Generated with Claude Code