Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-2809: fix data race while shutting down TFakeTestServer #2810

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
fix review issues
SvartMetal committed Jan 9, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 038d493f66102996732b06f3d56a081552b14c4b
6 changes: 5 additions & 1 deletion cloud/blockstore/libs/discovery/test_server.cpp
Original file line number Diff line number Diff line change
@@ -17,6 +17,8 @@
#include <util/system/mutex.h>
#include <util/thread/factory.h>

#include <chrono>

namespace NCloud::NBlockStore::NDiscovery {

namespace {
@@ -162,7 +164,9 @@ struct TFakeBlockStoreServer::TImpl
void* tag;
bool ok;
while (!AtomicGet(ShouldStop)) {
const auto deadline = gpr_time_0(GPR_TIMESPAN);
const auto deadline =
std::chrono::system_clock::now() +
std::chrono::milliseconds(100);
auto status = CQ->AsyncNext(&tag, &ok, deadline);
if (status != grpc::CompletionQueue::GOT_EVENT) {
continue;
SvartMetal marked this conversation as resolved.
Show resolved Hide resolved