Skip to content

Commit

Permalink
Merge pull request #3314 from G8XSU/event-logging
Browse files Browse the repository at this point in the history
Add logging around event processing.
  • Loading branch information
tnull authored Sep 16, 2024
2 parents 22146a9 + 85eb814 commit 02973ea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lightning-background-processor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,17 @@ macro_rules! define_run_body {
let mut have_decayed_scorer = false;

loop {
log_trace!($logger, "Processing ChannelManager events...");
$process_channel_manager_events;
log_trace!($logger, "Done processing ChannelManager events.");

log_trace!($logger, "Processing ChainMonitor events...");
$process_chain_monitor_events;
log_trace!($logger, "Done processing ChainMonitor events.");

log_trace!($logger, "Processing OnionMessageHandler events...");
$process_onion_message_handler_events;
log_trace!($logger, "Done processing OnionMessageHandler events.");

// Note that the PeerManager::process_events may block on ChannelManager's locks,
// hence it comes last here. When the ChannelManager finishes whatever it's doing,
Expand All @@ -340,7 +348,9 @@ macro_rules! define_run_body {
// ChannelManager, we want to minimize methods blocking on a ChannelManager
// generally, and as a fallback place such blocking only immediately before
// persistence.
log_trace!($logger, "Processing PeerManager events...");
$peer_manager.as_ref().process_events();
log_trace!($logger, "Done processing PeerManager events.");

// Exit the loop if the background processor was requested to stop.
if $loop_exit_check {
Expand Down

0 comments on commit 02973ea

Please sign in to comment.