Repository navigation
refactor(server): extract admission state kernel lifecycle - #328
Conversation
SunSi12138
left a comment
There was a problem hiding this comment.
Follow-up review on exact head 21a3ebef8e05b97dffd49cc13c5cf1209153d657: both prior P2 findings are cleanly addressed. Final program-drain completion now follows physical state disposal + controller detach + reclaim completion, and the deterministic disposal barrier proves kernel Dispose cannot return early. Reclamation also severs the long-lived initial lifecycle controller's program/rule/partition references, with a WeakReference regression proving the old program/state graph is collectable while the lifecycle owner/kernel/replacement remain alive. I re-audited the detach path against request generation-use/lease ordering, subsequent candidate creation, and Stop/Dispose; no new P1/P2 found. Exact-head PR Quick 32682326498 is green. #328 can close for the #324 lifecycle/state-kernel slice.
Implements #324 as the next stack slice above #323.
Stack base: reviewed #323 exact head
0711faa11500b22f08efb9a5225b53bd008ac479(issue-322-admission-program-generation).Scope
Limited to the #324 implementation manual:
AdmissionStateKernelownership for mutable Admission state/lifecycle;AdmissionProgramlifecycle;Out of scope remains out of scope: no public runtime Admission mutation API, numeric limiter resize, dynamic queue policy changes, rate migration/algorithm replacement, partition selector/config migration,
ServerResourceGovernorchanges, decode/fair-scheduler changes, or connection-admission dynamic configuration.Review follow-up
Addressed both reclamation/lifecycle review findings in
21a3ebef8e05b97dffd49cc13c5cf1209153d657:IsReclaimed/ReclaimCountno longer publish completion before state disposal;KernelDisposeShouldWaitUntilFinalReclaimedStateIsDisposedblocks final state disposal and proves kernelDisposeAsynccannot return early;ReclaimedInitialControllerOwnerShouldNotRootOldProgramOrStatekeeps the lifecycle owner, kernel, and incompatible replacement alive while WeakReferences prove the reclaimed initial program and limiter state are collectable.Exact-head validation
Exact PR head:
21a3ebef8e05b97dffd49cc13c5cf1209153d657PR Quick: https://github.com/SunSi12138/SharpLink/actions/runs/32682326498 — PASS
133398ok / 0 fail at26678.51 qps; c=4524351ok / 0 fail at104863.12 qps; 0.00% errorssuccess=777916,injected=168104,unexpected=0,restarts=11,clientErrors=0,serverErrors=0,unobserved=0; retained diagnostic1490984 -> 1053888 (-29.32%)chaos-pr-smoke, artifact ID9504597103, SHA-256d6961d0bb6553fa699f5fd1a695145ad5ba001d76c79030d81ac7489f2b974ee#324 lifecycle / reclamation diagnostics
Deterministic tests prove the issue matrix rather than relying on timing-luck stress:
QueueOneWayCallspolicy remains per-Request across compatible publication;LiveProgramCount=1,RetiredProgramCount=0,RuleStateCount=1during steady state and finish with all three at zero;ObjectDisposedExceptionfrom old work.The prior #323 DynamicAdmissionGeneration suite remains green, including controlled rejection/connection-reuse paths and retained-request budget cleanup.
ServerResourceGovernorownership remains independent and unchanged by this slice.Both review threads have been addressed and resolved. PR is Ready for Review and remains stacked on #323. No merge or auto-merge has been performed.
Refs #324, #264, #273, #323, #319.