Prevent double panic in query system, improve diagnostics
This commit is contained in:
parent
e3f909b2bb
commit
2bf2455925
2 changed files with 17 additions and 4 deletions
|
@ -181,8 +181,15 @@ where
|
|||
cache.complete(key, result, dep_node_index);
|
||||
|
||||
let job = {
|
||||
let mut lock = state.active.lock_shard_by_value(&key);
|
||||
lock.remove(&key).unwrap().expect_job()
|
||||
let val = {
|
||||
// don't keep the lock during the `unwrap()` of the retrieved value, or we taint the
|
||||
// underlying shard.
|
||||
// since unwinding also wants to look at this map, this can also prevent a double
|
||||
// panic.
|
||||
let mut lock = state.active.lock_shard_by_value(&key);
|
||||
lock.remove(&key)
|
||||
};
|
||||
val.unwrap().expect_job()
|
||||
};
|
||||
|
||||
job.signal_complete();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue