Skip to content

Commit

Permalink
fix(interactive): fix dead lock caused by write lock (alibaba#3459)
Browse files Browse the repository at this point in the history
<!--
Thanks for your contribution! please review
https://github.com/alibaba/GraphScope/blob/main/CONTRIBUTING.md before
opening an issue.
-->

## What do these changes do?

<!-- Please give a short brief about these changes. -->

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this
change? -->

Fixes
alibaba#3450
  • Loading branch information
lnfjpt authored Dec 28, 2023
1 parent 64ebe09 commit 4a23938
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions interactive_engine/executor/engine/pegasus/pegasus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ where
{
init_env();
let cancel_hook = sink.get_cancel_hook().clone();
let mut lock = JOB_CANCEL_MAP.write().expect("lock poisoned");
lock.insert(conf.job_id, cancel_hook);
if let Ok(mut lock) = JOB_CANCEL_MAP.write() {
lock.insert(conf.job_id, cancel_hook);
} else {
return Err(BuildJobError::from("JOB_CANCEL_MAP is poisoned;"))?;
}
let peer_guard = Arc::new(AtomicUsize::new(0));
let conf = Arc::new(conf);
let workers = allocate_local_worker(&conf)?;
Expand Down

0 comments on commit 4a23938

Please sign in to comment.