Repository navigation
MCP: Darling's blocking, deadlock and long query tools say where their data starts (part of #4966) - #5171
Merged
Conversation
…4966) ReadEventAsync takes the earlier of the coverage probe's floor and the oldest event a page shows, the rule Lite's event-list tools use. Probe also takes several sources and answers the earliest, for a page fed by two collectors. Nothing calls them yet.
…r data starts (part of #4966)
… the backfill test (part of #4966)
…and get_deadlocks The pins still guard the same properties: the registry is passed, and the web keeps its own preview length.
# Conflicts: # Darling/Darling.Tests/McpPayloadContractCensusTests.cs
This was referenced Oct 5, 2026
erikdarlingdata
marked this pull request as ready for review
October 5, 2026 05:44
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 an MCP client sees
get_blocking,get_deadlocks,get_deadlock_detail,get_blocked_process_xmlandget_long_query_completionsnow writeeffective_start,window_truncatedandtruncation_noteright afterhours_back, the same three keys and wording Darling's other data-start tools use. An empty answer carries them underhints. If the coverage probe fails, the rows still come back, without the keys (and an empty answer without hints). A window of 90 minutes or less that returns rows starts no probe.The event-time rule
These are event lists: a collector's first run can store events stamped before itself. The start named is the earlier of the probe's answer and the oldest event the page shows, so a notice never names a start later than a row on the same page. A backfilled event gives no notice.
Coverage source per tool
All five use
DataWindowFloor.Source.ForCollectorTable:get_deadlocks,get_deadlock_detail:deadlocks.get_blocked_process_xml:blocked_process_reportsonly (the XML exists only there).get_blocking: bothblocked_process_reportsanddmv_blocking_snapshots, the earliest winning, because its page merges both sources.get_long_query_completions:long_query_completions.A blocked process report collector turned on after the server was registered reads as covered from the registration, as in every other Darling coverage note.
Test plan
DarlingMcpBlockingToolsLivePostgresTestsTotal: 9, Failed: 6 (the other 3 cases were already green).McpToolsListBudgetTests5/0,McpPayloadContractCensusTests68/0 (rosters updated),EffectiveStartUtcTests14/0,McpPageContractTests43/0.--no-incremental: 0 warnings.LivePostgresCollectionHygieneTests, the allowed one).On the web page
None of these five reads is in the web note's own list, so the web server page's Blocking, Deadlocks, Deadlock Graphs, Blocked Process Reports and Long Query Completions grids now show the tool's own note above the grid when its window was cut, the way the Top Queries, Active Queries and Query Heatmap grids already do. No page code changed.
Review fixes, at
fa396eb7cget_blockingalways probes both the blocked process report and the DMV blocking snapshot coverage, the earlier winning, because its page merges both sources;get_blocked_process_xmlstays on the reports alone.get_blocking27,129 (its budget class),get_deadlock_detail22,839; in the read-tool budget classget_blocking19,436,get_long_query_completions17,809,get_deadlock_detail17,763,get_blocked_process_xml13,489,get_deadlocks7,130. All pass.DarlingMcpBlockingToolsLivePostgresTests9, the three budget classes, the census (68), the formatter pins (14) and the page contract (43), all 0 failed; the guard family 956 with its one allowed WPF-only failure.CHANGELOG
SECTION: Fixed
ENTRY: - Darling's blocking, deadlock and long query tools say where their data starts ([#5171]) - get_blocking, get_deadlocks, get_deadlock_detail, get_blocked_process_xml and get_long_query_completions now report effective_start, window_truncated and truncation_note, so an empty or short answer over a window the store does not reach back to is no longer read as nothing happened.
REF: [#5171]: #5171
Part of #4966