Skip to content

Commit

Permalink
Merge pull request #213 from BurtonQin/conflict-lock
Browse files Browse the repository at this point in the history
store: fix deadlock caused by conflicting lock order
  • Loading branch information
valeriansaliou authored Jun 7, 2020
2 parents fd7a21b + 0236cce commit c616e75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/store/fst.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,11 @@ impl StoreFSTPool {
// Notice: this prevents store to be acquired from any context
let _access = GRAPH_ACCESS_LOCK.write().unwrap();

let graph_pool_read = GRAPH_POOL.read().unwrap();
let graph_consolidate_read = GRAPH_CONSOLIDATE.read().unwrap();

for key in &*graph_consolidate_read {
if let Some(store) = GRAPH_POOL.read().unwrap().get(&key) {
if let Some(store) = graph_pool_read.get(&key) {
let not_consolidated_for = store
.last_consolidated
.read()
Expand Down

0 comments on commit c616e75

Please sign in to comment.