Build a bounded retry loop for deadlock and lock-timeout errors, roll back each failed transaction, and keep diagnostics beside retries.
Intra-Query Parallel Deadlock: When One Query Blocks Itself
No error, no deadlock graph, just a report that is slow on some runs. Here is a demo where one query deadlocks with itself, and how to fix it.





