From 29bdf44406499a461f80126aa60d4d0c2b0222d4 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Fri, 1 Mar 2024 13:50:01 +0100 Subject: [PATCH] [net:poll] Add log line when the reactor wakes up without commands (#136) This commit removes the debug assert since it occurs a few times. Therefore, the debug assert is replaced with a warning log line, allowing us to track the frequency of this occurrence. Signed-off-by: Vincenzo Palazzo --- net/poll/src/reactor.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/net/poll/src/reactor.rs b/net/poll/src/reactor.rs index e8eb547f..436f606b 100644 --- a/net/poll/src/reactor.rs +++ b/net/poll/src/reactor.rs @@ -244,9 +244,12 @@ impl nakamoto_net::Reactor for Reactor { } popol::Waker::reset(ev.source).ok(); - // Nb. This assert has triggered once, but I wasn't available - // to reproduce it. - debug_assert!(!commands.is_empty()); + // Nb. This should not happen, but it has been reported + // a few times. So we try to log a warning message and + // see how often this occurs. + if commands.is_empty() { + log::warn!(target: "poll", "waken up by waker received without commands"); + } for cmd in commands.try_iter() { service.command_received(cmd);