Skip to content

Commit

Permalink
Merge pull request #3508 from tnull/2025-01-fix-spammy-async-om-event…
Browse files Browse the repository at this point in the history
…-handling-logs-main

Fix overly spammy `TRACE` logging in async onion message event handling (main)
  • Loading branch information
tnull authored Jan 8, 2025
2 parents 262d789 + 1c0e463 commit 2c0066e
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions lightning/src/onion_message/messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1445,11 +1445,14 @@ where
let future = ResultFuture::Pending(handler(ev));
futures.push(future);
}
// Let the `OnionMessageIntercepted` events finish before moving on to peer_connecteds
let res = MultiResultFuturePoller::new(futures).await;
log_trace!(self.logger, "Done handling events async, results: {:?}", res);
let mut res_iter = res.iter().skip(intercepted_msgs_offset);
drop_handled_events_and_abort!(self, res_iter, self.pending_intercepted_msgs_events);

if !futures.is_empty() {
// Let the `OnionMessageIntercepted` events finish before moving on to peer_connecteds
let res = MultiResultFuturePoller::new(futures).await;
log_trace!(self.logger, "Done handling events async, results: {:?}", res);
let mut res_iter = res.iter().skip(intercepted_msgs_offset);
drop_handled_events_and_abort!(self, res_iter, self.pending_intercepted_msgs_events);
}
}

{
Expand All @@ -1472,10 +1475,13 @@ where
let future = ResultFuture::Pending(handler(event));
futures.push(future);
}
let res = MultiResultFuturePoller::new(futures).await;
log_trace!(self.logger, "Done handling events async, results: {:?}", res);
let mut res_iter = res.iter();
drop_handled_events_and_abort!(self, res_iter, self.pending_peer_connected_events);

if !futures.is_empty() {
let res = MultiResultFuturePoller::new(futures).await;
log_trace!(self.logger, "Done handling events async, results: {:?}", res);
let mut res_iter = res.iter();
drop_handled_events_and_abort!(self, res_iter, self.pending_peer_connected_events);
}
}
}
self.pending_events_processor.store(false, Ordering::Release);
Expand Down

0 comments on commit 2c0066e

Please sign in to comment.