[Server] Bound the server shutdown drain and make request admission an extension - #4148
[Server] Bound the server shutdown drain and make request admission an extension#4148marcschier wants to merge 1 commit into
Conversation
Factors request admission control and NodeManager lifecycle waiter tracking out of RequestManager into an optional registerable extension, so the request manager itself carries only the generic request tracking and drain machinery. With no extension registered the behaviour is exactly as before. The server-internal shutdown reserves its task slot under the coordination lock but starts the shutdown outside it, so no synchronous work runs under the lock. The deferred retry is bounded by a maximum attempt count and a time budget instead of retrying for as long as cleanup progress keeps increasing, and a terminal failure now surfaces through ServerError and a log rather than only being recorded on the shutdown state. Final node-manager cleanup is deliberately not cancellable: cancelling it would leak retired lifecycle state, node managers and the server semaphore after request admission has already been closed permanently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e6a5abf-3299-4cd1-9855-010fedbf0ad8
|
Closing this in favour of folding these tests into #4147. While preparing this PR I verified that its three intended source files - What was genuinely missing was the test coverage for that shutdown and request-admission No coverage is lost: these tests were validated on this branch at 3927 passing on |
Summary
Stack context
This PR is stacked on #4147 (
marcschier/wot-05-lifecycle) and intentionally needs its shutdown-progress members:MasterNodeManager.ShutdownCompletedNodeManagerCountandNodeManagerLifecycle.ShutdownCleanupProgress.The shutdown hardening remains minimal and in-place because the maintainer chose that over extracting a shutdown coordinator. The
AsyncLocalscope nesting is retained deliberately as a correctness fix; removingAsyncLocalis tracked separately.Validation
dotnet build src\Opc.Ua.Server\Opc.Ua.Server.csproj -c Release -f net10.0 -v:mdotnet build tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -p:CustomTestTarget=net10.0 -v:mdotnet test tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -p:CustomTestTarget=net10.0 --no-build— 3927 passed, 9 skippeddotnet build tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -p:CustomTestTarget=net48 -v:mdotnet test tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -p:CustomTestTarget=net48 --no-build— 3926 passed, 9 skipped, 1 known local-only failure (DurableDataValueQueueVerifyReferenceBatchingAsync)dotnet test tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -p:CustomTestTarget=net48 --no-build --filter FullyQualifiedName~DurableDataValueQueueVerifyReferenceBatchingAsync— isolated known flake passed