Right now we are doing is only logs where on each statement for a sql function we are raising an info.
This way we know which step its getting stuck. Today it got stuck on the insert statement.
And we ran the same SQL function after killing the process, it ran normal without any issues.
-Dhruv