You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Managed Instance: deadlocks and blocked process reports are never collected after the first run #6868
On an Azure SQL Managed Instance, the deadlocks and blocked_process_report collectors read their XE sessions only on the first run. Every later run logs shred_gated=1 and stores nothing. So deadlocks and blocked process reports on the instance are never collected, and get_deadlocks, get_blocking and the trend tools answer empty and call it a genuine all-clear.
Darling and Lite both do this, because they share the collectors.
Measured on a General Purpose test instance on 10-28, on dev dae4109:
The instance had a 35-second blocking episode at 14:38Z with blocked process threshold (s) set to 5, and a deadlock at 14:41:58Z.
The instance's ring buffers hold them. PerformanceMonitor_BlockedProcess has 6 blocked_process_report events and PerformanceMonitor_Deadlock has 1 xml_deadlock_report.
Every Darling and Lite run of both collectors after the first logs shred_gated=1, events_read=0 and 0 rows.
sys.dm_xe_session_targets.execution_count is 0 on every target of every session on the instance, ring_buffer and event_counter alike. That was 27 minutes after the sessions started, with events in the buffers.
Why
The #4200 gate (XeShredGate) skips the cast and shred when the ring_buffer target's execution_count equals the value the previous run stored. On a Managed Instance the count stays at 0. The first run has no stored value, so it reads. Every later run compares 0 with 0 and skips.
The attention collector on the same instance is not affected. Its gate also compares the event_counter target's own count, and that count moves. Azure SQL Database is not affected either, because the database-scoped execution_count moves.
Fix
Treat an execution_count of 0 as no signal and read, the same as NULL. This goes in the gate SQL of deadlocks (both the Azure SQL Database text and the server-scoped text) and blocked_process_report, and in XeShredGate.ShouldShred. A boxed server whose session has delivered nothing yet also shows 0, and reading an empty ring buffer costs little. On a Managed Instance this returns to the read every cycle that both collectors ran before #4200.
Activity
Shred when an XE target's execution_count reads 0 (#6868) (#6870)
erikdarlingdata commentedon Oct 28, 2026
Claude posting for Erik Darling.
Fixed by #6870, merged into dev.