
In fact, the algorithm for scheduler deadlock looks at the scheduler’s task queue (work to be processed) and monitors to see if tasks are being picked up in the queue. This is distinctly different from the lock monitor graph.

The scheduler deadlock is designed to detect when the scheduler does not appear to be making forward progress. The scheduler deadlock is detected by the Scheduler Monitor, not the lock monitor. Having a reproduction and the associated mini-dump capture allows Microsoft Support and the SQL Server Development to track down the source of the problem.Īs I discussed the ‘unresolved deadlock’ topic with some of my peers the ‘scheduler deadlock’ seemed to get intertwined and confused. It may not be easy but the fastest way to attack an ‘unresolved deadlock’ problem is to reproduce it.

If crash recovery succeeds the database is available for use but if crash recovery fails the database is marked suspect.įorcing an abort of a command that is already in rollback would not be the behavior you desire on your production server. Once all connections are terminated the database is reopened in order to execute crash recovery. Any rollback that fails causes SQL Server to take the database offline, killing all active sessions to the database. The session is already rolling back so it is unsafe to abort the rollback. Has to wait on a lock that results in a deadlock loop (Should not occur and usually a product bug as the lock should already have been acquired by the transaction.).Let me provide an example of an unsafe victim. Why is a target considered unsafe and not eligible to be a victim? The answer is specifically in the term unsafe. The key to the ‘unresolved deadlock’ error is the detection of a deadlock but a failure while attempting to select the victim to abort. Once a deadlock condition is detected the Lock Monitor performs the victim selection and signals the abort. It does this by building a lock graph (you may have seen partial visualization of this from the deadlock trace event.) As the graph is built the cycles can be detected, indicating a deadlock condition. The Lock Monitor is responsible for detecting and resolving deadlocks for SQL Server.

When an unresolved deadlock is detected a message is added to the SQL Server error log and a mini-dump is captured. It really takes an entire chapter to explain these conditions so I am going try to do it in a page or two?Īn unresolved deadlock is generally a SQL Server product issue. These are distinct errors but I have found that many people blend them together.
