Repository navigation
fix: reserve sandbox IDs until node cleanup completes - #445
Open
Floating-Y wants to merge 2 commits into
Open
Floating-Y wants to merge 2 commits into
Floating-Y wants to merge 2 commits into
Conversation
Signed-off-by: danwood <118035379+Floating-Y@users.noreply.github.com>
Signed-off-by: danwood <118035379+Floating-Y@users.noreply.github.com>
This branch has not been deployed
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.
Deleting
demoand immediately recreating it previously returned201with a new token while the old instance was still running. A subsequent node report could make the master dispatch the replacement's Exec to that old instance, even when the template changed.Persist a SQLite cleanup reservation for the ID, original node and creation token, network slot and gateway port. Explicit ID reuse now returns
409with a cleanup reason and no token until the owning node acknowledges successful removal of that exact instance. Sending Destroy, receiving a command or reporting an empty observation does not release the reservation.Bind sandbox commands, queued Exec and reported failures to the creation token. Nodes check tokens under the shared sandbox lock and persist retirement markers so delayed Exec, Destroy or Create commands cannot affect a replacement. Cleanup confirms that the cgroup is empty and local instance resources have been removed; failures remain retryable. Reservations and acknowledgement retries survive master/node restarts and disconnects.
DELETE continues to return
204and removes the API view immediately. After cleanup, the ID can be recreated with a fresh token; the old token is refused and unrelated IDs remain usable.Compatibility: upgrade the master before its nodes. Older nodes cannot acknowledge cleanup, so their reservations remain until those nodes are upgraded and report completion. New nodes reject unscoped commands against token-protected instances.
Validation
devatd27ab7c: both same-template and different-template regression cases failed before the fix, with201and actual Exec delivery to the old instance.master_apiregressions without timing sleeps, covering cleanup acknowledgements, ID reuse, old/new tokens, restart/disconnect recovery, queued Exec and stale reports. Tests inspect the commands the node receives.cargo test --all --quiet: 423 tests passed, including all 74master_apitests.cargo fmt --all -- --check: passed.cargo clippy --all-targets --all-features --quiet -- -D warnings: passed.cargo build --all --quiet: passed.Real runsc/Firecracker integration and performance benchmarks were not run.