From 41986ffcc3bf5b560c223bce69a0770deb746830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:00:28 +0200 Subject: [PATCH] Adjust AEC vacancy notification threshold --- nano/node/scheduler/hinted.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nano/node/scheduler/hinted.cpp b/nano/node/scheduler/hinted.cpp index 2532c45755..13a36d91bd 100644 --- a/nano/node/scheduler/hinted.cpp +++ b/nano/node/scheduler/hinted.cpp @@ -45,7 +45,12 @@ void nano::scheduler::hinted::stop () void nano::scheduler::hinted::notify () { - condition.notify_all (); + // Avoid notifying when there is very little space inside AEC + auto const limit = active.limit (nano::election_behavior::hinted); + if (active.vacancy (nano::election_behavior::hinted) >= (limit / 5)) + { + condition.notify_all (); + } } bool nano::scheduler::hinted::predicate () const