Skip to content

Commit

Permalink
Fix race condition when restarting plugins that leads to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Exidex committed Sep 8, 2024
1 parent 56096f8 commit cdcda9f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions rust/server/src/plugins/run_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl RunStatusHolder {
let mut running_plugins = self.running_plugins.lock().expect("lock is poisoned");

running_plugins
.get(plugin_id)
.remove(plugin_id)
.expect("value should always exist for specified id")
.cancel()
}
Expand All @@ -56,10 +56,3 @@ impl RunStatusGuard {
.cancelled_owned()
}
}

impl Drop for RunStatusGuard {
fn drop(&mut self) {
let mut running_plugins = self.running_plugins.lock().expect("lock is poisoned");
running_plugins.remove(&self.id);
}
}

0 comments on commit cdcda9f

Please sign in to comment.