From b6f274b7bc3b8117e88a83ce7535f7f109327ec0 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 18 Oct 2024 06:51:13 -0500 Subject: [PATCH] Check for is_quitting() for faster shutdown --- plugins/net_plugin/net_plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 2cb613aa37..636e204ed3 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -3694,6 +3694,8 @@ namespace eosio { // post to dispatcher strand so that we don't have multiple threads validating the block header peer_dlog(this, "posting block ${n} to dispatcher strand", ("n", ptr->block_num())); my_impl->dispatcher.strand.post([id, c{shared_from_this()}, ptr{std::move(ptr)}, cid=connection_id]() mutable { + if (app().is_quiting()) // large sync span can have many of these queued up, exit quickly + return; controller& cc = my_impl->chain_plug->chain(); auto fork_db_root_num = my_impl->get_fork_db_root_num();