From e0389ba90fc99eaaa0921f3ba321b54d427647a5 Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Thu, 1 Jun 2023 11:20:59 -0700 Subject: [PATCH] GeyserPluginService: Use common `exit` flag. (#31915) Geyser plugin thread would never shutdown correctly, as it is using an exit flag that is never set. --- core/src/validator.rs | 1 - geyser-plugin-manager/src/geyser_plugin_service.rs | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/validator.rs b/core/src/validator.rs index 3a5f12969..b7c7c1e69 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -581,7 +581,6 @@ impl Validator { )); } - let exit = Arc::new(AtomicBool::new(false)); { let exit = exit.clone(); config diff --git a/geyser-plugin-manager/src/geyser_plugin_service.rs b/geyser-plugin-manager/src/geyser_plugin_service.rs index 18babc7d4..a64190d6b 100644 --- a/geyser-plugin-manager/src/geyser_plugin_service.rs +++ b/geyser-plugin-manager/src/geyser_plugin_service.rs @@ -19,7 +19,10 @@ use { solana_runtime::accounts_update_notifier_interface::AccountsUpdateNotifier, std::{ path::{Path, PathBuf}, - sync::{atomic::AtomicBool, Arc, RwLock}, + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, RwLock, + }, thread, time::Duration, }, @@ -231,7 +234,7 @@ impl GeyserPluginService { } } - if exit.load(std::sync::atomic::Ordering::Relaxed) { + if exit.load(Ordering::Relaxed) { break; } })