pub struct DeadlockInfo {
pub source: DeadlockSource,
pub thread_cycle: Vec<ThreadId>,
pub thread_waiting_for_locks: Vec<(ThreadId, LockId)>,
pub lock_order_cycle: Option<Vec<LockId>>,
pub timestamp: String,
pub verification_request: Option<(LockId, ThreadId)>,
}Expand description
Represents the result of deadlock detection
This structure contains detailed information about a detected deadlock, including which threads are involved in the cycle and which locks they are waiting for. This information is passed to the deadlock callback and can be used to diagnose the root cause of the deadlock.
Fields§
§source: DeadlockSourceSource of the deadlock detection
Indicates whether this is a certain deadlock (WaitForGraph) or a suspected deadlock pattern (LockOrderViolation).
thread_cycle: Vec<ThreadId>List of threads involved in the deadlock cycle
This is the ordered list of threads that form a cycle in the wait-for graph. For example, if thread 1 is waiting for thread 2, and thread 2 is waiting for thread 1, the cycle would be [1, 2].
thread_waiting_for_locks: Vec<(ThreadId, LockId)>Map of threads to locks they’re waiting for
This provides additional context about which specific locks each thread in the cycle is waiting to acquire. Each tuple is (thread_id, lock_id).
lock_order_cycle: Option<Vec<LockId>>Lock order violation cycle (if detected via lock ordering)
When a deadlock is detected via lock order violation rather than an actual wait-for cycle, this field contains the cycle of locks that violates the established lock ordering. For example, if lock 1 -> lock 2 -> lock 3 -> lock 1 forms a cycle, this would be Some(vec![1, 2, 3, 1]).
timestamp: StringTimestamp when the deadlock was detected
ISO-8601 formatted timestamp indicating when the deadlock was detected.
verification_request: Option<(LockId, ThreadId)>Optional: Request for the lock wrapper to verify the deadlock
Trait Implementations§
Source§impl Clone for DeadlockInfo
impl Clone for DeadlockInfo
Source§fn clone(&self) -> DeadlockInfo
fn clone(&self) -> DeadlockInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more