Repository navigation
Thread cancellation through 7 Blocking web reads (#4203) - #4360
Merged
Merged
Conversation
get_blocked_process_xml, get_blocking, get_blocking_trend, get_deadlock_detail, get_deadlock_trend, get_deadlocks and get_lock_wait_trend now take a CancellationToken and pass it down to every store call, so an abandoned web request stops its query instead of running to completion. Removes the seven from CancellationAllowlist.
erikdarlingdata
marked this pull request as ready for review
September 26, 2026 01:11
This was referenced Sep 26, 2026
erikdarlingdata
added a commit
that referenced
this pull request
Sep 26, 2026
…33Z UTC (#4440) Moves the CHANGELOG entries carried in merged pull-request descriptions into [Unreleased]. The cut is PRs merged at or before 2026-09-26T17:37:33Z; the next splice starts after it. - 128 PRs are spliced: Fixed 87, Changed 20, Added 17 and Security 5. Each entry sits at the top of its section, newest PR first, and its link definition joins the trailing block. - 22 PRs have no user-visible entry (None, test-only, or deferred to a parent). - Three entries had no section in their description, and each was assigned from its diff: #4363, #4383 and #4380 go under Security. - Link fixes: the #4198 references point at the issue, and #4360's [#4203] label points at issue 4203. - #4208's entry is taken from its diff. - Two security entries are worded to the current state: #4351's rotation note, and #4363's journal-read line. - Only CHANGELOG.md changes.
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.
Refs #4203.
Why
Web
/api/read/*handlers give each readHttpContext.RequestAborted, but the seven blocking / deadlock tools inDarlingMcpBlockingTools.cswere onDarlingWebEndpoints.CancellationAllowlist: an abandoned request kept running its store query to completion instead of stopping. This slice follows #4357's pattern (the Performance-Trends tools) over the Blocking family.What changes
Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpBlockingTools.cs:get_blocked_process_xml,get_blocking(both overloads),get_blocking_trend,get_deadlock_detail,get_deadlock_trend,get_deadlocks,get_lock_wait_trend(both overloads) each take a trailingCancellationToken cancellationToken = defaultand pass it to every store call in the body (resolver, reader, capability/precondition status, capture-count and existence probes).catch (Exception ex)narrows tocatch (Exception ex) when (ex is not OperationCanceledException), so a cancellation propagates instead of being folded into an error payload.Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingServerResolver.cs:ResolveWithFingerprintNameAsyncgained aCancellationToken cancellationToken = defaultparameter (the get_blocking/get_deadlocks/get_deadlock_detail dedup_key path needs it) and threads it to its own registry read.Darling/PerformanceMonitor.Darling.Service/DarlingWebEndpoints.cs:CancellationAllowlist.c.RequestAborted.Test plan
dotnet build Darling/Darling.Tests/Darling.Tests.csproj -p:EnableWindowsTargeting=true: 0 warnings, 0 errors.PgTargetMcpSurfaceTests,McpServiceParameterDiSeatCensusTests,EngineCapabilityReadWiringTests,RuntimePreconditionReadWiringTests,WebReadCancellationPinTests(Windows-only; checked by inspection, no hardcoded allowlist count found,WebReadCancellationPinTestscomputes the shrink-only invariant dynamically against the dispatch table).CHANGELOG entry
SECTION: Fixed
ENTRY:
REF:
[Web /api/read/* handlers never thread RequestAborted into the underlying store query #4203]: Thread cancellation through 7 Blocking web reads (#4203) #4360
For the coordinator
CancellationAllowlistshrinks by 7 in this slice. This will conflict textually with #4357 (also editingDarlingWebEndpoints.cs's allowlist and dispatch table) — the tender resolving that conflict should keep both slices' removals and dispatch-table changes.pm-pr lane report (dev merge + verification)
Merge:
git merge origin/dev(dev at9ba47523) ontodfc2407awas a clean auto-merge (no manual conflict resolution needed) — the merge tool resolvedDarlingWebEndpoints.cson its own, keeping both siblings'CancellationAllowlistremovals and dispatch-tablec.RequestAbortedwiring. New head:87aa17694a654d2ad1c9d81d8ebc3afe6ce2b4da. Pushed with a plaingit push(no force); PR head confirmed as a merge parent before push.Allowlist diff (101 → 94): extracted the quoted-name set from
CancellationAllowlistatorigin/dev(101 entries) and at the merged HEAD (94 entries). Diff shows exactly the 7 tools removed (get_blocked_process_xml,get_blocking,get_blocking_trend,get_deadlock_detail,get_deadlock_trend,get_deadlocks,get_lock_wait_trend) and nothing added.Build:
dotnet build Darling/Darling.Tests/Darling.Tests.csproj -c Release→ Build succeeded, 0 Warning(s), 0 Error(s).Checks:
[McpServerTool]methods inDarlingMcpBlockingTools.cstakeCancellationToken cancellationToken = defaultand pass it toResolveWithFingerprintNameAsyncand their store/reader calls. NoCancellationToken.Nonefound in the file.ResolveWithFingerprintNameAsync's only other reference outside these 7 tools is the test census regex inMcpPayloadContractCensusTests.cs(no other production caller exists) — build's 0 errors confirms nothing else needed updating.catch (Exception ex) when (ex is not OperationCanceledException).dotnet runfor the test host fails with "No frameworks were found" forMicrosoft.WindowsDesktop.App, a known repo constraint).PgTargetMcpSurfaceTestsreflects on[McpServerTool]attribute names only, unaffected by this signature change.McpServiceParameterDiSeatCensusTestsexplicitly excludesCancellationTokenparameters from its DI census.EngineCapabilityReadWiringTests/RuntimePreconditionReadWiringTestsuse a text regex overNotCollectedStatusAsync(...)calls that already tolerates an optional trailingcancellationToken/ct/CancellationToken.Noneargument.WebReadCancellationPinTestscomputes its assertions dynamically offDarlingWebEndpoints.BuildReadDispatch()andCancellationAllowlist(no hardcoded count), so the shrink-only invariant holds structurally.pull/4203(the issue) instead ofpull/4360(this PR); now corrected. Body saysRefs #4203.