Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
4 changes: 3 additions & 1 deletion src/common/SubTimeFrameFileSource.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
24 changes: 16 additions & 8 deletions src/common/rpc/StfSenderRpcClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -306,14 +306,22 @@ class StfSenderRpcClientCollection {
bool lConnWorking = true;
mNumWorkingClients = 0;

std::vector<std::thread> 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;
Expand Down