Skip to content

Skip the free-slot suspension while a Session on the node initializes - #813

Merged
SaladDay merged 1 commit into
mainfrom
skip-free-slot-while-initializing
Oct 21, 2026
Merged

SaladDay merged 1 commit into
mainfrom
skip-free-slot-while-initializing

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

A node runs one lifecycle operation at a time. #811 stopped the free-slot suspension while a placed Session had no sandbox yet, but a Session whose sandbox exists still sends its preparation operations to the node during initialization. A free-slot suspension started in that window puts them behind the suspend.

On mx (run-pr812, 8cf120b) a Session's sandbox was created at 17:54:46.99, a free-slot suspension of another idle allocation started 0.25 s later, and the Session's restore_preparation waited queue_ms=4968 in the node queue. That Session reached ready in 19.2 s.

The free-slot rule now waits while any Session placed on the node has no allocation yet or its Environment initialization is pending or running (ListRuntimeStartingNodes). This replaces the Reserved placement count #811 added to placement.Node; the node list keeps its own reserved field for Web.

Checks: go vet ./..., go test ./internal/deployment/..., and the deploymentpg pressure and free-slot tests against Postgres 16 (TestFreeSlotWaitsForStartingSession covers both a placement waiting for its sandbox and an initializing allocation).


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

A node runs one operation at a time, so a free-slot suspension started
while a just-created Session initializes delays its preparation
operations behind the suspend. The free-slot rule now also waits while
any Session placed on the node has no sandbox or has not finished its
Environment initialization.
@SaladDay
SaladDay merged commit 0bd065b into main Oct 21, 2026
19 checks passed
@SaladDay
SaladDay deleted the skip-free-slot-while-initializing branch October 21, 2026 18:15
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