Hi Xuneng, Thanks for v10 and for finding the lock case. I tested it and have a few notes.
1. I am able to reproduce the case with your code and when it passed deadlock_timeout. And your V10 is able to cancel the deadlocked query. 2. V10 leaves the case where the delay has already passed as it was, one wait with no timeout. So the problem in CF 6445 [1] is still there. I think this patch is LGTM. [1] https://commitfest.postgresql.org/patch/6445/ Thanks, Shihao
