Skip to content

fix(pool): release the lease of a lane start cut off by the daemon's end - #566

Merged
7schmiede merged 2 commits into
mainfrom
fix/lease-orphan
Nov 18, 2026
Merged

7schmiede merged 2 commits into
mainfrom
fix/lease-orphan

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

A lane's lease on a node was noted on the requester (followed.json) only once the lane's start there was over. A daemon that ended between the node's admission and that point (minutes on a first start: images, containers) left a lease nobody here knew: devstack lane stop said the lane was not started, and every devstack up met the node's 409 ... runs here already (lease <id>) until the lease's grace ran out (an hour on a dedicated node, #379).

  • The daemon notes the lease (leasing.json in the lane's state) as soon as the node admits it, and drops the note once the lane is followed or its failed start released the lease.
  • The next daemon releases a lease still noted when it starts (remote_lane_start_released) and says so with the lane (its start was cut off, devstack up starts it again).
  • The lane's next start releases one first as well, should the node not have answered at the daemon's start.
  • A note whose lease is followed after all (the daemon ended between the two notes) is dropped, not released.

No review card: a fix within ADR-0052 point 6 (#379), no new contract or term.

Root cause and class

Tests

  • remote_lane.rs (Linux, Docker): the daemon is killed right after the node admitted the lane's lease; the next up --on must start the lane. Pushed alone first: red in CI before the fix commit.
  • Unit test of the note: kept until followed or released, another lease's end leaves it, a followed lease is not released.

Closes #563

🤖 Generated with Claude Code

@7schmiede

Copy link
Copy Markdown
Member Author

Red probe: with the test alone (cc592dc), remote-lane failed where expected: after the daemon was killed right after the lease's admission, the next up --on got 409: lane wtoffixture runs here already (lease eb3ce35a38ac9193) (run 44297510202). The fix follows in c3e6187.

@7schmiede
7schmiede marked this pull request as ready for review November 18, 2026 12:38
7schmiede and others added 2 commits November 18, 2026 13:38
Kills the daemon right after the node admitted the lane's lease, before
the lane is followed, and expects the lane's next start to succeed (#563).
Red without the fix: the node refuses it as running there already.

Refs #563

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lane's lease on a node was noted here (followed.json) only once its
start there was over. A daemon that ended between the node's admission
and that point (minutes on a first start) left a lease nobody knew:
`lane stop` said the lane was not started, and every `up` met the node's
"runs here already" until the lease's grace ran out, up to an hour.

The daemon now notes the lease (leasing.json) as soon as the node admits
it, and drops the note once the lane is followed or its failed start
released the lease. The next daemon releases a lease still noted when it
starts and says so with the lane; the lane's next start releases one
first as well, should the node not have answered then.

Closes #563

Bug-Class: orphaned-lease
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 0d4e680 into main Nov 18, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/lease-orphan branch November 18, 2026 12:48
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 pool lane survives a client daemon restart, but the client can neither adopt nor stop it (409 runs here already)

1 participant