From c84bab166cc6daaebaec89a2ca6e9cb0dd6f384a Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 3 Apr 2024 11:37:50 -0500 Subject: [PATCH] GH-2102 Add logging on app().quit() --- plugins/net_plugin/net_plugin.cpp | 1 + programs/nodeos/main.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 709d820f38..db0d97c3dd 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -4376,6 +4376,7 @@ namespace eosio { set_producer_accounts(producer_plug->producer_accounts()); thread_pool.start( thread_pool_size, []( const fc::exception& e ) { + elog("Exception in net thread, exiting: ${e}", ("e", e.to_detail_string())); app().quit(); } ); diff --git a/programs/nodeos/main.cpp b/programs/nodeos/main.cpp index a13f0abcce..44f3572e06 100644 --- a/programs/nodeos/main.cpp +++ b/programs/nodeos/main.cpp @@ -161,6 +161,10 @@ int main(int argc, char** argv) uint32_t short_hash = 0; fc::from_hex(eosio::version::version_hash(), (char*)&short_hash, sizeof(short_hash)); + app->set_stop_executor_cb([&app]() { + ilog("appbase quit called"); + app->get_io_service().stop(); + }); app->set_version(htonl(short_hash)); app->set_version_string(eosio::version::version_client()); app->set_full_version_string(eosio::version::version_full());