Skip to content

Fix UTC/local timezone mismatch in blocked process XML processor#383

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/blocked-process-utc-timezone
Mar 1, 2026
Merged

Fix UTC/local timezone mismatch in blocked process XML processor#383
erikdarlingdata merged 1 commit intodevfrom
fix/blocked-process-utc-timezone

Conversation

@erikdarlingdata
Copy link
Owner

Summary

  • The blocked process XML processor was passing UTC dates (from XE @timestamp) to sp_HumanEventsBlockViewer, which expects local time inputs
  • This caused double UTC conversion internally, and the verification query compared UTC dates against local-time parsed results — always returning 0 matches
  • All 86 recent NO_RESULTS failures in config.collection_log were caused by this bug
  • Adds UTC→local conversion (DATEDIFF(MINUTE, GETUTCDATE(), SYSDATETIME())) matching the pattern already used in 25_process_deadlock_xml.sql

Test plan

  • Deployed to sql2022, reset 489 rows to unprocessed, ran with @debug = 1
  • Verified UTC→local conversion in debug output (8-hour offset applied correctly)
  • 118 parsed blocking events created (previously 0 due to timezone mismatch)
  • All rows correctly marked as processed
  • Scheduled job confirmed working end-to-end with new live blocking events

🤖 Generated with Claude Code

The processor was passing UTC dates (from XE @timestamp) to
sp_HumanEventsBlockViewer which expects local time inputs. This caused
double UTC conversion internally, and the verification query compared
UTC dates against local-time parsed results — always returning 0 matches.
All 86 recent failures were caused by this bug.

Adds @utc_offset_minutes conversion so derived UTC dates are translated
to local before being passed to sp_HumanEventsBlockViewer, the DELETE
of stale parsed results, and the verification COUNT. Raw table UPDATE
still uses UTC dates correctly. Matches the pattern already used in
25_process_deadlock_xml.sql.

Tested on sql2022: 489 XML events processed, 118 parsed blocking events
created, scheduled job confirmed working end-to-end.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit a06125f into dev Mar 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant