Skip to content

fix(master): enforce admission for pinned sandbox placement - #441

Open
Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/pinned-node-admission
Open

Floating-Y wants to merge 1 commit into
deeplethe:devfrom
Floating-Y:fix/pinned-node-admission

Conversation

@Floating-Y

Copy link
Copy Markdown
Collaborator

POST /v1/sandboxes accepted explicit node_id placement without checking whether the node was connected, admitting work, switching backends, or able to fit the whole batch. Source-pinned snapshot forks used the same path.

Route Place::Node through pick_node_where with candidates restricted to the requested ID and the full batch count. Successful creates use the node's actual pool; unavailable targets return the scheduler's 503 and increment refused once per request. Preserve existing template/backend/snapshot compatibility 409s, max_sandboxes=0 semantics, and transaction boundaries.

Extend the existing capacity regression matrix across pool placement, explicit template placement, and implicit/explicit source-pinned snapshot forks. Verify missing/offline targets, no rerouting to a healthy spare, exact remaining capacity, resource admission, and unchanged sandbox records, gateway ports, and network slots after refusal.

Validation in WSL Ubuntu:

  • Before the fix: master_api reported 66 passed / 3 failed; the regressions received 201 instead of 503.
  • cargo test -p sandstorm-core --test master_api: 69 passed / 0 failed after the fix.
  • cargo test -p sandstorm-core --test backends: 12 passed / 0 failed.
  • cargo fmt --all -- --check and git diff --check passed.

Based on dev at d27ab7c.

This branch has not been deployed

No deployments
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.

1 participant