deadlock detection and recovery