Skip to content

fix(pool): a node ends the lease of a lane whose container is gone (#565) - #567

Merged
7schmiede merged 1 commit into
mainfrom
fix/lease-gone
Nov 18, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/lease-gone

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

A node ended a lease only when its requester released it, an admin ended it or its grace ran out (an hour on a dedicated node). Two leases held the lane's slot and the node's capacity longer than anything used them (#565, follow-up to #563):

  1. A lane container that is gone (stopped by hand on the node, exited, removed): the lane's status and up failed on its daemon (the lane's daemon: failed to lookup address information), and a requester that had lost the lease got 409 ... runs here already (lease <id>) until the grace ran out.
  2. A warm lease whose daemon ended (ADR-0065) while its prepare ran: it held its capacity for the grace.

Changes:

  • Each round (background, every 15 s) the node looks at which lane containers run (docker ps --filter label=devstack.lease --filter status=running). A started lease whose container did not run in this round and the one before ends as an expired one, with why=gone in node_lease_ended. A start under way or failed (starting), a lease not started yet (no stack_file) and a Docker that does not answer end nothing.
  • A warm lease lives at most 3 minutes without a renewal (its requester renews every 30 s); a shorter lease_grace_minutes still wins.
  • The requester's daemon names the stopped container among the reasons a lease is over; it already said that devstack up starts the lane again.
  • docs/pool.md, CHANGELOG.md.

No review card: node housekeeping and a timeout, decided with the owner at the start (2026-11-18).

Verification

Cause The node ended leases by release, expiry or an admin only; whether the lane container still ran was never checked. A warm lease had a lane's grace.
Bug class stale-state
Red A probe lane on a dedicated pool node, its container stopped with docker stop: status 502, up failed on the lane's daemon, also after a restart of the requester's daemon; the lease stayed. The two new unit tests failed at their assertions before the fix.
Green This build briefly as that node's agent: the stuck lease ended within ~45 s, the requester logged remote_lane_ended, up started the lane at once; a running lane stayed over several rounds. The node runs its released agent again.
Tests Unit: a_started_lease_whose_lane_container_is_gone_ends_in_the_second_round, a_warm_lease_lives_a_few_minutes_without_a_renewal. Integration (remote_lane.rs, Linux CI job "lane on a node"): the lane container stopped, the lease ends, up runs it again.
Siblings Only the node's round ends leases by time; the coordinator follows the nodes' reports. The client side of a lost lease is #563.

Closes #565

🤖 Generated with Claude Code

)

A node ended a lease only when its requester released it, an admin ended
it or its grace ran out. A lane container stopped by hand (or exited, or
removed) kept its lease, and with it the lane's slot and share of the
node, for the whole grace: the lane's `status` and `up` failed on its
daemon, and a requester that had lost the lease got `409 ... runs here
already`. A warm lease whose daemon ended held its capacity as long.

Each round the node now looks at which lane containers run: a started
lease whose container did not run in this round and the one before ends
as an expired one (`why=gone`); a start under way or failed, a lease not
started yet and a Docker that does not answer end nothing. A warm lease
lives at most 3 minutes without a renewal. The requester's daemon names
the stopped container among the reasons a lease is over.

Bug-Class: stale-state

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 18c5767 into main Nov 18, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/lease-gone branch November 18, 2026 12:38
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.

A node holds a lease whose lane container is gone, and a warm lease whose daemon ended, for the whole grace

1 participant