add geyser logging
This commit is contained in:
parent
de5362d4bb
commit
d3e5206055
|
@ -82,6 +82,9 @@ impl GeyserPluginService {
|
|||
let transaction_notifications_enabled = plugin_manager.transaction_notifications_enabled();
|
||||
let entry_notifications_enabled = plugin_manager.entry_notifications_enabled();
|
||||
let plugin_manager = Arc::new(RwLock::new(plugin_manager));
|
||||
debug!(
|
||||
"account_data_notifications_enabled: {}, transaction_notifications_enabled: {}, entry_notifications_enabled: {}",
|
||||
account_data_notifications_enabled, transaction_notifications_enabled, entry_notifications_enabled);
|
||||
|
||||
let accounts_update_notifier: Option<AccountsUpdateNotifier> =
|
||||
if account_data_notifications_enabled {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use log::{info, warn};
|
||||
use {
|
||||
crate::slot_status_notifier::SlotStatusNotifier,
|
||||
crossbeam_channel::Receiver,
|
||||
|
@ -50,30 +51,38 @@ impl SlotStatusObserver {
|
|||
Builder::new()
|
||||
.name("solBankNotif".to_string())
|
||||
.spawn(move || {
|
||||
info!("solBankNotif task started");
|
||||
while !exit.load(Ordering::Relaxed) {
|
||||
if let Ok(slot) = bank_notification_receiver.recv() {
|
||||
match slot {
|
||||
SlotNotification::OptimisticallyConfirmed(slot) => {
|
||||
slot_status_notifier
|
||||
.read()
|
||||
.unwrap()
|
||||
.notify_slot_confirmed(slot, None);
|
||||
}
|
||||
SlotNotification::Frozen((slot, parent)) => {
|
||||
slot_status_notifier
|
||||
.read()
|
||||
.unwrap()
|
||||
.notify_slot_processed(slot, Some(parent));
|
||||
}
|
||||
SlotNotification::Root((slot, parent)) => {
|
||||
slot_status_notifier
|
||||
.read()
|
||||
.unwrap()
|
||||
.notify_slot_rooted(slot, Some(parent));
|
||||
match bank_notification_receiver.recv() {
|
||||
Ok(slot) => {
|
||||
match slot {
|
||||
SlotNotification::OptimisticallyConfirmed(slot) => {
|
||||
slot_status_notifier
|
||||
.read()
|
||||
.unwrap()
|
||||
.notify_slot_confirmed(slot, None);
|
||||
}
|
||||
SlotNotification::Frozen((slot, parent)) => {
|
||||
slot_status_notifier
|
||||
.read()
|
||||
.unwrap()
|
||||
.notify_slot_processed(slot, Some(parent));
|
||||
}
|
||||
SlotNotification::Root((slot, parent)) => {
|
||||
slot_status_notifier
|
||||
.read()
|
||||
.unwrap()
|
||||
.notify_slot_rooted(slot, Some(parent));
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(_recv_error) => {
|
||||
// A message could not be received because the channel is empty and disconnected.
|
||||
warn!("solBankNotif channel disconnected");
|
||||
}
|
||||
}
|
||||
}
|
||||
info!("solBankNotif task look ended");
|
||||
})
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
@ -159,14 +159,19 @@ impl OptimisticallyConfirmedBankTracker {
|
|||
slot_notification_subscribers: &Option<Arc<RwLock<Vec<SlotNotificationSender>>>>,
|
||||
notification: SlotNotification,
|
||||
) {
|
||||
|
||||
inc_new_counter_info!("slot_notification-total", 1);
|
||||
if let Some(slot_notification_subscribers) = slot_notification_subscribers {
|
||||
for sender in slot_notification_subscribers.read().unwrap().iter() {
|
||||
match sender.send(notification.clone()) {
|
||||
Ok(_) => {}
|
||||
Err(err) => {
|
||||
Ok(_) => {
|
||||
inc_new_counter_info!("slot_notification-sent", 1);
|
||||
}
|
||||
Err(_err) => {
|
||||
inc_new_counter_info!("slot_notification-failed", 1);
|
||||
info!(
|
||||
"Failed to send notification {:?}, error: {:?}",
|
||||
notification, err
|
||||
"Failed to send notification {:?}, error: disconnected",
|
||||
notification
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue