Skip to content

Skip the free-slot suspension while a Session waits for its sandbox - #811

Merged
SaladDay merged 1 commit into
mainfrom
free-slot-reserved
Oct 21, 2026
Merged

SaladDay merged 1 commit into
mainfrom
free-slot-reserved

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What users see

A new hosted Session placed on a full node no longer waits behind a free-slot suspension. On the test cluster one Session waited 6.6 s for it.

Cause

A placement counts as active before its sandbox exists. Right after a Session was placed on a node, the node looked full again, and the node lane, still in the same scan, found an allocation idle for over 2 minutes and suspended it under the free-slot rule. The lane creates sandboxes only between scans, so the placed Session's sandbox came after that suspension.

mx test, Core log (UTC): S1's allocation suspended at 15:17:52.450, S3 was placed on the freed slot, then fc970892 (idle since a regression case) started quiescing at 15:17:52.558 and was suspended at 15:17:59.152; S3's create started at 15:17:59.19.

Changes

  • placement.Node carries Reserved (placements without an allocation), which ListRuntimeNodes already counts.
  • The free-slot rule also requires Reserved == 0 on the node. A later scan keeps the slot free once the placed Session has its sandbox.
  • docs/sandbox-provider.md and its Chinese mirror state the condition.

Tests

TestFreeSlotWaitsForPlacedSession: an allocation idle for 3 minutes on a node that is full only because of a waiting placement is refused (ErrNotIdle). It fails without the new condition. Ran go test ./internal/persistence/postgres/deploymentpg -run 'TestPressure|TestFreeSlot|Suspension|Suspend', go test ./internal/deployment/... and go vet ./... for services/core.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

A placement counts as active before its sandbox exists, so a node looked
full right after a Session was placed on it. The node lane then ran a
free-slot suspension and created the placed Session's sandbox only after it.
@SaladDay
SaladDay merged commit d893afb into main Oct 21, 2026
19 checks passed
@SaladDay
SaladDay deleted the free-slot-reserved branch October 21, 2026 15:33
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