1
Fork 0

Rollup merge of #121913 - Zoxc:query-fix, r=compiler-errors

Don't panic when waiting on poisoned queries

This fixes a bug introduced in https://github.com/rust-lang/rust/pull/119086.
This commit is contained in:
Matthias Krüger 2024-03-05 06:40:32 +01:00 committed by GitHub
commit c483e637f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -285,9 +285,8 @@ where
let lock = query.query_state(qcx).active.get_shard_by_value(&key).lock(); let lock = query.query_state(qcx).active.get_shard_by_value(&key).lock();
match lock.get(&key) { match lock.get(&key) {
Some(QueryResult::Poisoned) => { // The query we waited on panicked. Continue unwinding here.
panic!("query '{}' not cached due to poisoning", query.name()) Some(QueryResult::Poisoned) => FatalError.raise(),
}
_ => panic!( _ => panic!(
"query '{}' result must be in the cache or the query must be poisoned after a wait", "query '{}' result must be in the cache or the query must be poisoned after a wait",
query.name() query.name()