I have an instance of SQL Server 2017 Enterprise with CU16.
The is a SQL Agent job that has two steps. Occasionally, the first step does not finish and does not complete the stored procedure within it. The SQL Agent Job History reads: "The statement has been terminated. [SQLSTATE 01000] (Message 3621). The step succeeded." But this sure does seem like a failure to me!!!
The settings on this step are On failure action: Quit the job reporting failure. So the step should fail and stop right there and not go on to step 2. But it does.
Does anyone have any experience with this? Any resolution? Am I crazy or is this not bug in SQL Server?
Please also note: I created a Deadlock Extended Event and no deadlock occurred during the procedure. I have looked in SQL Server log files and don't see any messages. I have activated the additionally logging as seen in the image above, and it does not reveal anything. SQL Server did not shut down during the process. The account running the stored procedure is a sysadmin. The stored procedure fails at different points within it. I tried implementing a TRY CATCH block and no errors were raised.
Thanks in advance!