diff --git a/nano/node/active_elections.cpp b/nano/node/active_elections.cpp index d5282451..93ebb095 100644 --- a/nano/node/active_elections.cpp +++ b/nano/node/active_elections.cpp @@ -47,6 +47,11 @@ nano::active_elections::active_elections (nano::node & node_a, nano::ledger_noti } } + if (workers.queued_tasks () >= nano::queue_warning_threshold () && warning_interval.elapse (15s)) + { + node.logger.warn (nano::log::type::active_elections, "Notification queue has {} tasks", workers.queued_tasks ()); + } + // Notify observers about cemented blocks on a background thread workers.post ([this, results = std::move (results)] () { auto transaction = node.ledger.tx_begin_read (); diff --git a/nano/node/active_elections.hpp b/nano/node/active_elections.hpp index 8f49010e..e8416bdd 100644 --- a/nano/node/active_elections.hpp +++ b/nano/node/active_elections.hpp @@ -171,6 +171,7 @@ private: nano::thread_pool workers; nano::interval bootstrap_stale_interval; + nano::interval warning_interval; friend class election; diff --git a/nano/node/block_processor.cpp b/nano/node/block_processor.cpp index d7464493..2adbe8c4 100644 --- a/nano/node/block_processor.cpp +++ b/nano/node/block_processor.cpp @@ -277,6 +277,10 @@ void nano::block_processor::run () // It's possible that ledger processing happens faster than the notifications can be processed by other components, cooldown here ledger_notifications.wait ([this] { stats.inc (nano::stat::type::block_processor, nano::stat::detail::cooldown); + if (log_cooldown_interval.elapse (15s)) + { + logger.warn (nano::log::type::block_processor, "Cooldown in block processing, waiting for remaining ledger notifications to be processed"); + } }); lock.lock (); diff --git a/nano/node/block_processor.hpp b/nano/node/block_processor.hpp index 22ea8d85..25a47186 100644 --- a/nano/node/block_processor.hpp +++ b/nano/node/block_processor.hpp @@ -104,5 +104,6 @@ private: nano::interval log_processing_interval; nano::interval log_backlog_interval; + nano::interval log_cooldown_interval; }; }