I solved this problem by refreshing lock timeout each time.
Yes, I have ever had a patch to take locks out of waiting list if a covering RPC is coming. However, this way will have to modify the state of dlm lock, for example, to remember how many active RPCs existing. That's a stateful implementation.
After thinking about it, I decided to stay with current stateless implementation because of:
1. less possibilities of producing bugs;
2. lock timeout is rare event in the system, so performance shouldn't be a problem.
How do you think?
I think if we have a simple solution to the problem that works, then we don't need a complex solution to the problem. If there is nothing here left to be fixed, then this bug can be closed.