Abort in deadlock handler if we fail to get a query map

This commit is contained in:
John Kåre Alsaker 2025-03-16 23:59:10 +01:00
parent 01dc45c10e
commit 077b8d5c37
5 changed files with 25 additions and 12 deletions

View file

@ -588,7 +588,7 @@ pub fn print_query_stack<Qcx: QueryContext>(
// state if it was responsible for triggering the panic.
let mut count_printed = 0;
let mut count_total = 0;
let query_map = qcx.collect_active_jobs();
let query_map = qcx.collect_active_jobs().0;
if let Some(ref mut file) = file {
let _ = writeln!(file, "\n\nquery stack during panic:");

View file

@ -86,7 +86,7 @@ pub trait QueryContext: HasDepContext {
/// Get the query information from the TLS context.
fn current_query_job(self) -> Option<QueryJobId>;
fn collect_active_jobs(self) -> QueryMap;
fn collect_active_jobs(self) -> (QueryMap, bool);
/// Load a side effect associated to the node in the previous session.
fn load_side_effect(

View file

@ -250,8 +250,9 @@ where
Q: QueryConfig<Qcx>,
Qcx: QueryContext,
{
let error =
try_execute.find_cycle_in_stack(qcx.collect_active_jobs(), &qcx.current_query_job(), span);
let (query_map, complete) = qcx.collect_active_jobs();
assert!(complete, "failed to collect active queries");
let error = try_execute.find_cycle_in_stack(query_map, &qcx.current_query_job(), span);
(mk_cycle(query, qcx, error), None)
}