Repository navigation
Conversation
The freed active slot admits no Session when the node's retained slots are full, so the free-slot rule now also needs a free retained slot. SetCompute loads the suspension demand once for both checks.
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.
What users see
A new hosted Session no longer waits for an idle allocation to suspend when its node is full. Core keeps one active slot free per node: an allocation idle for at least 2 minutes on a node with no free active slot but a free retained slot may be suspended without waiting demand. The suspended Session's next Turn resumes it (about 1.9 s). The idle timeout (
idle_seconds, default 300 s) is unchanged; if it is shorter than 2 minutes the ordinary timeout already applies.Changes
SetComputealso allows running to quiescing when the allocation has been idle for 2 minutes (freeSlotIdle), its node passes the same deployment and node checks as demand suspension (nodes mode, not resetting, same installation, online,Active >= MaxActive), the node has a free retained slot (a suspended allocation keeps its retained slot, so without one the freed active slot admits no Session), and no reclamation is in flight on that node.fullNode;SetComputeloads the suspension demand once for both rules, and the demand path is otherwise unchanged. Busy and wake-requested allocations are still refused.docs/sandbox-provider.mdand its Chinese mirror describe the rule in the Suspension paragraph and the Timeouts and limits table.Measured
Before this change a new Session on a full node waited for a suspend of 5.5–7.8 s (median 6.2 s over 15 runs). Resuming the suspended Session takes about 1.9 s.
Tests
TestPressureSuspensionRequiresUsefulCapacitygains a full node idle past 2 minutes (allowed) a node with a free slot at the same idle (ErrNotIdle) and a full node whose retained slots are full (ErrNotIdle); the existing 1-minute no-demand case still returnsErrNotIdle. Rango test ./internal/persistence/postgres/deploymentpg -run TestPressureSuspensionandgo vet ./...forservices/core.Need help on this PR? Tag
@codesmith-botwith what you need.