Detects query cycles by using depth first search over all active query jobs.
If a query cycle is found it will break the cycle by finding an edge which
uses a query latch and then resuming that waiter.
There may be multiple cycles involved in a deadlock, so this searches
all active queries for cycles before finally resuming all the waiters at once.
Finds out if thereโs a path to the compiler root (aka. code which isnโt in a query)
from query without going through any of the queries in visited.
This is achieved with a depth first search.
Looks for a query cycle by doing a depth first search starting at query.
span is the reason for the query to execute. This is initially DUMMY_SP.
If a cycle is detected, this initial value is replaced with the span causing
the cycle. stack will contain just the cycle on return if detected.
Finds the query job closest to the root that is for the same query method as id
(but not necessarily the same query key), and returns information about it.
Looks for a query cycle using the last query in jobs.
If a cycle is found, all queries in the cycle is removed from jobs and
the function return true.
If a cycle was not found, the starting query is removed from jobs and
the function returns false.
The locaton of a resumable waiter. The usize is the index into waiters in the queryโs latch.
Weโll use this to remove the waiter using QueryLatch::extract_waiter if weโre waking it up.