Skip to content

Wake placement as soon as capacity or preparation is ready - #809

Merged
SaladDay merged 3 commits into
mainfrom
capacity-wake
Oct 21, 2026
Merged

SaladDay merged 3 commits into
mainfrom
capacity-wake

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

What users see

Faster cold start of a hosted Session on a full node. No behavior or API change.

Changes

  • A placement that failed because nodes are full (placement.ErrNodeUnavailable) now hints every existing node lane, so demand suspension and checkpoint expiry start immediately instead of on the lane's next 5 s tick.
  • A freed node slot (compute saved as "suspended", ReleaseAllocation, ReleaseLostCompute) wakes the manager's placement loop; direct lanes free no node slot and send nothing, instead of waiting for its next 5 s tick.
  • Completing Environment initialization wakes the Worker scheduler instead of waiting for the next 250 ms scan.
  • Tickers stay as the recovery path; hints only accelerate.

Measured

Test cluster, 5 Sessions, node max_active 3 (Core logs + node journal):

  • Placement failing for capacity to the node lane starting suspension or release: 1.4-4.0 s wasted.
  • Suspension or release finishing to the next placement attempt: 2.2-4.9 s wasted.
  • Initialization completing to the pending input being picked up: up to one 250 ms scan.

Tests

  • TestCapacityFailedPlacementHintsNodeLanes: a capacity-failed placement hints the node lane.
  • TestFreedSlotWakesPlacement: a freed slot wakes placement and coalesces.
  • go vet ./... (services/core) and go test ./internal/execution -run 'Placement|Wake|Suspend|FreedSlot|Capacity' pass.

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

Placement now hints the lanes only when it failed for capacity, so a
generation rollout or reset does not double every lane's scans. A direct
lane frees no node slot, and the freed-slot wake is a plain channel send.
@SaladDay
SaladDay merged commit e6519f3 into main Oct 21, 2026
19 checks passed
@SaladDay
SaladDay deleted the capacity-wake branch October 21, 2026 13:50
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