fix(server): persist sandbox labels on create#2306
Open
matthewgrossman wants to merge 1 commit into
Open
Conversation
|
All contributors have signed the DCO ✍️ ✅ |
drew
approved these changes
Jul 15, 2026
Author
|
I have read the DCO document and I hereby sign the DCO. |
Collaborator
|
/ok to test 5c4109f |
5c4109f to
ad64479
Compare
Signed-off-by: Matthew Grossman <matthewryangrossman@gmail.com> Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
ad64479 to
c05b9b5
Compare
drew
approved these changes
Jul 16, 2026
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.
Summary
create_sandboxwriteWhat went wrong
Sandbox labels are stored in two places: the protobuf payload and a separate labels column used by selector queries. The initial
create_sandboxcall wrote the protobuf payload with labels but passedNonefor the labels column, so the row was created with an empty label map.A later driver status reconciliation rewrote the sandbox through
update_message_cas, which derives and backfills the labels column from the protobuf. That made selector visibility depend on whether the first reconciliation had completed. Newly created sandboxes could therefore be returned bygetwhile remaining invisible tolist(label_selector=...).This explains the timing-dependent failure in the E2E CI job: an older sandbox had already reconciled and matched the selector, while the most recently created sandbox had not.
The fix serializes
sandbox.metadata.labelsfor the initial conditional write. Because both SQLite and Postgres selectors use the dedicated labels column, fixing this caller addresses both backends.Validation
cargo test -p openshell-server compute::tests::— 37 passedcargo clippy -p openshell-server --lib --tests -- -D warningscargo fmt --all -- --checkgit diff --check