]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add logging around event processing.
authorG8XSU <3442979+G8XSU@users.noreply.github.com>
Fri, 13 Sep 2024 18:30:49 +0000 (11:30 -0700)
committerG8XSU <3442979+G8XSU@users.noreply.github.com>
Fri, 13 Sep 2024 21:02:49 +0000 (14:02 -0700)
Currently we don't have any visibility if BackgroundProcessor
takes considerably more of time to process events, adding logs
to help debug such issues.

lightning-background-processor/src/lib.rs

index 4a9248ca347daf8e603e0b97aab7ffdc4f312199..d9dc6518cefdddf83302dcc5c29378ccc8a8ba42 100644 (file)
@@ -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,
@@ -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 {