Skip to content

Commit

Permalink
Fix geyser plugin unload crash (solana-labs#34026)
Browse files Browse the repository at this point in the history
Explicit ordering of the drop of Library and Boxed<dyn GeyserPlugin>: drop the latter explicitly first to avoid crash.
  • Loading branch information
lijunwangs authored Nov 15, 2023
1 parent 693d576 commit b5659af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion geyser-plugin-manager/src/geyser_plugin_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,13 @@ impl GeyserPluginManager {
}

fn _drop_plugin(&mut self, idx: usize) {
let current_lib = self.libs.remove(idx);
let mut current_plugin = self.plugins.remove(idx);
let _current_lib = self.libs.remove(idx);
let name = current_plugin.name().to_string();
current_plugin.on_unload();
drop(current_plugin);
drop(current_lib);
info!("Unloaded plugin {name} at idx {idx}");
}
}

Expand Down

0 comments on commit b5659af

Please sign in to comment.