What happens when a client timeout occurs during the execution of a stored procedure that raises XACT_ABORT and wraps its body in TRY/CATCH blocks?
I am looking at a bunch of procedures that generally can be converted to an MWE as follows:
create or alter procedure ##ptx
as
begin try
set xact_abort on
waitfor delay '10:00'
end try
begin catch
declare @xsx int = XACT_STATE()
raiserror('XSX=%d', 16, 10, @xsx) with log, nowait
end catch
I created a test harness that logs into the server as SA, asynchronously calls such procedure, and times out the call after X seconds but earlier than the delay should run out. There are no new entries in the log, so it looks like the execution does not enter the CATCH block when a timeout occurs. Should it? If it should not, then what happens upon the client timeout?