Skip to content

Add logging around event processing. #3314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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...");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lmk, if we want to combine all of them into one "Processing events..."

Or want to log individual events as well or just types of 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
Loading