Skip to content

Commit

Permalink
store: fix deadlock caused by conflicting lock order
Browse files Browse the repository at this point in the history
Signed-off-by: BurtonQin <bobbqqin@gmail.com>
  • Loading branch information
BurtonQin committed Jun 4, 2020
1 parent fd7a21b commit 0236cce
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 0236cce

Please sign in to comment.