Skip to content
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

Add logging around event processing. #3314

Merged
merged 1 commit into from
Sep 16, 2024
Merged

Conversation

G8XSU
Copy link
Contributor

@G8XSU G8XSU commented Sep 13, 2024

Currently we don't have any visibility if BackgroundProcessor takes considerably more of time to process events,
adding logs to help debug such issues.

Currently we don't have any visibility if BackgroundProcessor
takes considerably more of time to process events, adding logs
to help debug such issues.
@@ -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.

Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.98%. Comparing base (a75fdab) to head (85eb814).
Report is 29 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3314      +/-   ##
==========================================
+ Coverage   89.66%   89.98%   +0.32%     
==========================================
  Files         126      126              
  Lines      102411   104389    +1978     
  Branches   102411   104389    +1978     
==========================================
+ Hits        91826    93935    +2109     
+ Misses       7857     7742     -115     
+ Partials     2728     2712      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

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

LGTM

@tnull tnull merged commit 02973ea into lightningdevkit:main Sep 16, 2024
19 of 21 checks passed
@TheBlueMatt
Copy link
Collaborator

This is gonna be really verbose, and I don't think we want that. Instead, we should probably log before actually calling into the event handlers (with the event type) in the event generating methods.

@tnull
Copy link
Contributor

tnull commented Sep 16, 2024

This is gonna be really verbose

Hmm, good point, especially now with looping when events are replayed, this could get really spammy. Seems I merged this one prematurely.

@G8XSU
Copy link
Contributor Author

G8XSU commented Sep 16, 2024

Uh oh..
I was worried about the same, that's why I had added a comment on it. 😅
Will log once for every event: here(https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/chain/channelmonitor.rs#L1251) and similarly i guess.

@tnull
Copy link
Contributor

tnull commented Sep 17, 2024

Uh oh.. I was worried about the same, that's why I had added a comment on it. 😅 Will log once for every event: here(https://github.com/lightningdevkit/rust-lightning/blob/main/lightning/src/chain/channelmonitor.rs#L1251) and similarly i guess.

Mhh, yeah, that improves things, but I'm not convinced this really solves the verbosity issue as in case of event handling failure we immediately loop back without any added delay. That means if we hit a persistence failure we might keep spamming the logs until the failure is resolved (e.g., we reconnected to remote persistence). Also, in case logs are persisted towards the same backend, we might further bog down IO with spamming a lot log writes? I think if we add logging there, we need to add some delay (exponential backoff?), as we had considered before but didn't end up doing in the fallible event handler PR(s)?

Btw, if we're now logging at the event-handling level, we could also log event handling errors?

@tnull
Copy link
Contributor

tnull commented Sep 23, 2024

Now tracking here to make sure we don't forget: #3331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants