Skip to content

Commit 381f1a8

Browse files
authored
Set LOCK_TIMEOUT
SET LOCK_TIMEOUT 1000 when APPLY sys.dm_exec_query_statistics_xml to prevent mutex issues. Set GitHub BrentOzarULTD#3210
1 parent d8f30b2 commit 381f1a8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎sp_BlitzFirst.sql‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,8 +2293,9 @@ If one of them is a lead blocker, consider killing that query.'' AS HowToStopit,
22932293
CROSS APPLY sys.dm_exec_query_plan(r.plan_handle) AS qp ';
22942294

22952295
IF EXISTS (SELECT * FROM sys.all_objects WHERE name = 'dm_exec_query_statistics_xml')
2296-
SET @StringToExecute = @StringToExecute + N' OUTER APPLY sys.dm_exec_query_statistics_xml(s.session_id) qs_live ';
2297-
2296+
/* GitHub #3210 */
2297+
SET @StringToExecute = N'
2298+
SET LOCK_TIMEOUT 1000 ' + @StringToExecute + N' OUTER APPLY sys.dm_exec_query_statistics_xml(s.session_id) qs_live ';
22982299

22992300
SET @StringToExecute = @StringToExecute + N';
23002301

0 commit comments

Comments
 (0)