From 80791711d68db6c48c448558750a07debf80d5f5 Mon Sep 17 00:00:00 2001 From: Dmytro Sydorchenko Date: Thu, 18 May 2023 20:25:58 -0400 Subject: [PATCH] fixing hunter build and few c++ errors --- CMakeLists.txt | 4 ++-- cmake/Hunter/config.cmake | 11 +---------- cmd/engine_plugin.cpp | 1 + silkrpc/http/server.cpp | 13 +++++++++---- silkworm | 2 +- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebe7c002..b64cb1d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,8 @@ include(silkworm/third_party/evmone/cmake/cable/bootstrap.cmake) include(CableBuildInfo) include(silkworm/third_party/evmone/cmake/cable/HunterGate.cmake) HunterGate( - URL "https://github.com/cpp-pm/hunter/archive/v0.24.3.tar.gz" - SHA1 "10738b59e539818a01090e64c2d09896247530c7" + URL "https://github.com/cpp-pm/hunter/archive/v0.24.16.tar.gz" + SHA1 "09668c254f01afeca1b3d3d2e4692ed5e0e39dcc" FILEPATH "${CMAKE_SOURCE_DIR}/cmake/Hunter/config.cmake" ) diff --git a/cmake/Hunter/config.cmake b/cmake/Hunter/config.cmake index d360c8ae..44bf9312 100644 --- a/cmake/Hunter/config.cmake +++ b/cmake/Hunter/config.cmake @@ -15,13 +15,4 @@ ]] # silkworm configuration -include(${CMAKE_SOURCE_DIR}/silkworm/cmake/Hunter/config.cmake) - -hunter_config( - asio-grpc - VERSION 2.0.0 - URL https://github.com/Tradias/asio-grpc/archive/refs/tags/v2.0.0.tar.gz - SHA1 a727806a5c93c811e8f73ecb1e733efc4739d5ff - CMAKE_ARGS - ASIO_GRPC_USE_BOOST_CONTAINER=ON -) +include(${CMAKE_SOURCE_DIR}/silkworm/cmake/Hunter/config.cmake) \ No newline at end of file diff --git a/cmd/engine_plugin.cpp b/cmd/engine_plugin.cpp index e71a8f20..20021e43 100644 --- a/cmd/engine_plugin.cpp +++ b/cmd/engine_plugin.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/silkrpc/http/server.cpp b/silkrpc/http/server.cpp index 68dfc6c0..124b4bfd 100644 --- a/silkrpc/http/server.cpp +++ b/silkrpc/http/server.cpp @@ -78,6 +78,7 @@ boost::asio::awaitable Server::run() { SILKRPC_DEBUG << "Server::run accepting using io_context " << io_context << "...\n" << std::flush; std::shared_ptr new_connection; + bool wait_and_continue = false; try { new_connection = std::make_shared(context_, workers_, handler_table_); @@ -85,15 +86,19 @@ boost::asio::awaitable Server::run() { } catch (const boost::system::system_error& se) { if (se.code() == boost::asio::error::no_descriptors) { SILKRPC_WARN << "Server::run too many open connections\n" << std::flush; - boost::asio::steady_timer timer(acceptor_.get_executor()); - timer.expires_after(boost::asio::chrono::milliseconds(100)); - co_await timer.async_wait(boost::asio::use_awaitable); - continue; + wait_and_continue = true; } else { throw; } } + if (wait_and_continue) { + boost::asio::steady_timer timer(acceptor_.get_executor()); + timer.expires_after(boost::asio::chrono::milliseconds(100)); + co_await timer.async_wait(boost::asio::use_awaitable); + continue; + } + if (!acceptor_.is_open()) { SILKRPC_TRACE << "Server::run returning...\n"; co_return; diff --git a/silkworm b/silkworm index 7ce45cce..6f1f4b93 160000 --- a/silkworm +++ b/silkworm @@ -1 +1 @@ -Subproject commit 7ce45cce0de202ddb59179773a3827fb811cd702 +Subproject commit 6f1f4b93c4e989faae0aa2370a7d78f9d115cb80