aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/client_sync.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-01 16:54:51 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-02-01 16:54:51 -0800
commit7ec4748502436cc6fb453f0348f6c8868b03b7d3 (patch)
tree434c5406ee909abb7f0f25bd6913e6fe8f575aad /test/cpp/qps/client_sync.cc
parent3a63d4c005c1dba4f021a7ecfc7f1481fb703527 (diff)
Improve sync streaming benchmark, fix deadlock that can occur sometimes
Diffstat (limited to 'test/cpp/qps/client_sync.cc')
-rw-r--r--test/cpp/qps/client_sync.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc
index b1e61865e7..498416c64a 100644
--- a/test/cpp/qps/client_sync.cc
+++ b/test/cpp/qps/client_sync.cc
@@ -153,7 +153,6 @@ class SynchronousStreamingClient final : public SynchronousClient {
if (*stream) {
(*stream)->WritesDone();
Status s = (*stream)->Finish();
- EXPECT_TRUE(s.ok());
if (!s.ok()) {
gpr_log(GPR_ERROR, "Stream %zu received an error %s", i,
s.error_message().c_str());
@@ -173,7 +172,11 @@ class SynchronousStreamingClient final : public SynchronousClient {
entry->set_value((UsageTimer::Now() - start) * 1e9);
return true;
}
- return false;
+ auto* stub = channels_[thread_idx % channels_.size()].get_stub();
+ context_[thread_idx].~ClientContext();
+ new (&context_[thread_idx]) ClientContext();
+ stream_[thread_idx] = stub->StreamingCall(&context_[thread_idx]);
+ return true;
}
private: