Skip to content

Managed Instance: deadlocks and blocked process reports are never collected after the first run #6868

Closed

Description

@erikdarlingdata

Claude posting for Erik Darling.

What happens

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

  1. added
    bugSomething isn't working
    owner:pm-worker-helperLaptop helper session: click-test fixes. Other sessions leave these alone.
    on Oct 28, 2026
  2. erikdarlingdata commented on Oct 28, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling.

    Fixed by #6870, merged into dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingowner:pm-worker-helperLaptop helper session: click-test fixes. Other sessions leave these alone.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions