fix(blaze): reject incomplete sandbox resets - #2290
Draft
WeissonHan wants to merge 1 commit into
Draft
Conversation
Reset previously changed only lifecycle metadata before returning a still running sandbox to the warm pool. Reuse could expose runtime or storage state that the caller expected the operation to discard. Return 501 for an existing sandbox before changing lifecycle state, metrics, runtime ownership, or pool membership. Warm-pool tests now use a test-only fixture instead of relying on the incomplete production endpoint. This does not implement reset. Success remains unavailable until runtime and storage can be reset as one operation. Fixes: 1f0cfac ("feat(anvil): scaffold local orchestrator crate skeleton") Signed-off-by: Weisson Han <wenshu.hx@linux.alibaba.com>
Collaborator
Author
|
@codex review Please review exact head |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Why
The reset endpoint returned success after changing only lifecycle metadata and
placing the same running sandbox in the warm pool. It did not reset runtime or
storage contents, so a later warm claim could reuse state that the caller
expected reset to discard.
Before this change, reset could return a false success and mutate lifecycle,
persisted state, pool membership, and metrics. After this change, an existing
sandbox receives
501 Not Implementedbefore any of those values or itsruntime owner can change.
What changed
metrics on rejection.
the incomplete production endpoint.
Commit structure
Commit 1,
fix(blaze): reject incomplete sandbox resets, contains the APIguard, the invariant regression, test-fixture correction, and the matching
bilingual API summary.
These changes belong in one PR because the code and documentation correct one
false-success contract. Splitting the test fixture or API summary would leave a
revision that either cannot test warm reuse independently or still advertises
behavior the endpoint does not provide.
Still to do
complete operation; that capability is not part of this bugfix.
Related issue
closes #2288
User / Agent impact
Clients that called the incomplete reset path now receive an explicit
501instead of a misleading success response. Other instance and warm-pool
operations are unchanged.
Risk and compatibility
This intentionally changes only the unsupported reset response. A client that
treated the old false success as valid must handle
501until complete resetsupport exists.
Validation
Verified on Linux x86_64 for commit
7068096ec2792dc3f630726375f88dd7552f4d8f(tree7561d64adacf9890587e2448ffe7cf4722a63000, archive SHA-256790fcd1d72cdc181a856c84149a926f895b2c9af4f7356a5bb59831d1e22e233),from
src/blaze:cargo fmt --all -- --checkcargo test --workspace --locked(blaze-core 52, blazed 108)cargo test --workspace --all-features --locked(blaze-core 52, blazed 118)git diff --checkDocumentation and rollback
The English and Chinese component README files now mark reset as reserved and
returning
501. Reverting the single commit restores the old behavior; nopersisted-data conversion is required.