Repository navigation
fix(pool): leases of cut-off starts stay noted until let go; a start waiting for its slot is not gone - #572
Merged
Merged
Conversation
…waiting for its slot is not gone Review of #565 and #563 before 0.49.4: - The node ended a lease as `gone` while its start waited (up to 120 s) for the lane's last lease to take its containers down: its stack file was set, its container not there yet and it not yet in `starting`. A lease whose slot is busy is no longer judged. - `leasing.json` holds a list: a new start no longer writes over the note of a lease whose release did not get through (its node did not answer). - A start that failed keeps its lease's note when the release did not get through (only a release or a 404 drops it), so the next daemon or start tries again. - A daemon releases only the leases noted when it started, read before its API serves, not the note of a start begun through it since. Bug-Class: stale-state Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
What and why
A code review before 0.49.4 (documented internally) found four flaws in the two pool fixes merged today, #565 (#567) and #563 (#566). Neither is released yet, so no changelog entry of its own.
gone(node).start()sets the lease's stack file and then waits up to 120 s for the lane's last lease to take its containers down, before the lease is instarting. Two rounds without a container ended it. A lease whose slot is busy is no longer judged (gone_leases).leasing.jsonholds a list. A new start wrote over the note of a lease whose release had not got through (its node did not answer), and that lease was forgotten.lib.rsbefore the take-up thread and before a start through the API can note its own. Before, the take-up thread read the file after the (possibly slow) remote take-ups and could release the lease of anupbegun meanwhile.A note written by the first builds (one object, not a list) is still read.
Verification
stale-statenode::tests::a_start_waiting_for_its_slot_is_not_gone(ended as gone),remote::tests::a_lease_whose_release_failed_stays_noted_beside_a_new_one(["l2"]instead of["l1","l2"]),a_failed_start_keeps_its_note_until_its_lease_is_let_go(note gone),the_leases_left_by_an_earlier_daemon_are_the_only_ones_released(the new lease tried); all failed at their assertions before the fix.cargo test -p devstack-node --lib119,-p devstack-daemon --lib223, clippy clean.followed.jsonstays one note (a lane follows one lease).Refs #563, #565
🤖 Generated with Claude Code