From 074bea7d9fe6ec416ec47afe504b788307c9c481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Kr=C4=8D=C3=A1l?= Date: Thu, 18 Jan 2024 13:14:54 +0100 Subject: [PATCH 1/3] Revert "TMP: workaround to fix boost deprecation warning" This reverts commit d0aada8270a88b14139c9b13f438aadadce0430a. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bfeb70d..558c3b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -ffast-math -DNDEBUG -fno-omit-frame-poi set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math -DNDEBUG") if(NOT APPLE) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror -Wno-deprecated-declarations") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror") endif() From 2629d4ed3288ebec85edd244edd19d7fd2103b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Kr=C4=8D=C3=A1l?= Date: Thu, 1 Feb 2024 10:25:46 +0100 Subject: [PATCH 2/3] Replace deprecated boost:process:child:wait_for --- src/common/SubTimeFrameFileSource.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/SubTimeFrameFileSource.cxx b/src/common/SubTimeFrameFileSource.cxx index 8d28d66..b020282 100644 --- a/src/common/SubTimeFrameFileSource.cxx +++ b/src/common/SubTimeFrameFileSource.cxx @@ -371,7 +371,9 @@ void SubTimeFrameFileSource::DataFetcherThread() bp::child lCopyChild(bp::search_path("sh"), lCopyParams, bp::std_err > mCopyCmdLogFile, bp::std_out > mCopyCmdLogFile); - while (!lCopyChild.wait_for(5s)) { + // Report progress every 5 seconds + for (auto lCopyChildFuture = std::async(std::launch::async, [&]() { lCopyChild.wait(); }); + std::future_status::timeout == lCopyChildFuture.wait_for(5s); ) { IDDLOG("(Sub)TimeFrame source: waiting for copy command. cmd='{}'", lRealCmd); } From 46b295d3ed1724861a20d2a4fa71630ee207eda7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Kr=C4=8D=C3=A1l?= Date: Wed, 25 Oct 2023 12:13:36 +0200 Subject: [PATCH 3/3] Parallelize gRPC test connections Test connections from TfBuilder to StfSender are now executed in parallel and with a 5x5s timeout. --- src/common/rpc/StfSenderRpcClient.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/common/rpc/StfSenderRpcClient.h b/src/common/rpc/StfSenderRpcClient.h index 9c7e233..217ad39 100644 --- a/src/common/rpc/StfSenderRpcClient.h +++ b/src/common/rpc/StfSenderRpcClient.h @@ -84,7 +84,7 @@ class StfSenderRpcClient { lParam.set_tf_builder_id("-1"); StfDataResponse lRet; ClientContext lContext; - lContext.set_deadline(std::chrono::system_clock::now() + std::chrono::milliseconds(1000)); + lContext.set_deadline(std::chrono::system_clock::now() + std::chrono::milliseconds(5000)); lContext.set_wait_for_ready(true); auto lRetVal = mStub->StfDataRequest(&lContext, lParam, &lRet); @@ -306,14 +306,22 @@ class StfSenderRpcClientCollection { bool lConnWorking = true; mNumWorkingClients = 0; + std::vector threads; for (auto &[ mCliId, lClient] : mClients) { - // attempt the test StfDataRequest() - if (!lClient->StfDataRequestTest()) { - EDDLOG("StfSender gRPC connection is not working. stfs_id={} grpc_status={}", mCliId, lClient->grpc_status()); - lConnWorking = false; - continue; - } - mNumWorkingClients += 1; + threads.emplace_back([&, mCliId, lClient]() { + // attempt the test StfDataRequest() + if (!lClient->StfDataRequestTest()) { + EDDLOG("StfSender gRPC connection is not working. stfs_id={} grpc_status={}", mCliId, lClient->grpc_status()); + lConnWorking = false; + return; + } + mNumWorkingClients += 1; + }); + } + + // Join all threads + for (auto &thread : threads) { + thread.join(); } return lConnWorking;