Repository navigation
feat(runtime): share cancellable per-node admission across lifecycle entrypoints - #504
Merged
Merged
Conversation
Share one cancellable per-node gate between RPC and scheduler starts so same-node starts cannot both admit against the same persisted active memory. Hold the gate from before CheckStartCapacity through container mutation and status persistence in StartServer/RestartServer/RecreateServer and in the scheduler start/restart tasks. Map refusals and cancellation to existing Connect codes. Wire the coordinator once at the composition root; constructors supply an instance-owned default for isolated uses. ADR 0014 records why this is an in-process gate rather than a persistent lease.
Independent review found three scheduler-owned paths checked persisted capacity without contending on the shared node gate. StartServerForBoot and staged publication with StartAfter now acquire around their capacity check through container mutation. DeepSleepManager.WakeServer holds the gate from before the wake preparer through StartContainer and running-status persistence; the preparer itself does not re-acquire. A small local AdmissionGate interface keeps the docker package from importing serverruntime. ADR 0014 and the lifecycle and deep-sleep concepts now name every gated path, with regression tests for each.
…sion-coordinator # Conflicts: # cmd/carbon-panel/main.go # internal/rpc/server.go # internal/scheduler/scheduler.go
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.
W15/OSS-334: shared in-process admission gate. One instance-owned coordinator is injected into ServerService and Scheduler; same-node start admission is serialized through mutation and status persistence, while different nodes proceed in parallel. Cancellation never enters the gate; release is idempotent; local aliases fold to one key.\n\nReal-store tests: same-node concurrent start refused with CodeResourceExhausted (one Docker start, one start journal row, no RPC-owned event), different-node parallel, queued waiter times out before Docker, scheduler same-node refusal/cross-node parallelism. ADR0014 documents in-process scope (not distributed lease) and knowledge is updated. Known limits: staged rollback covered by existing staged suites rather than a dedicated admission test; CI race/pinned-Go qualification still required before merge.