We have a very strange issue. We have noticed that a single stored procedure is executed twice when is called by Powershell invoke-sqlcmd command.
When we trace it we can see the procedure starts executing, stops in the middle without raising any errors and then (here is the issue:) a new SPID calls the same procedure again under the same ClientProcessID! There is no any code in the application to re-run the proc, and it is proved.
We know that the first call stops because of the Query Timeout interval is exceeded, but what triggers the proc to re-run the second time instead of just returning an error and stop?