diff options
author | Vijay Pai <vpai@google.com> | 2017-12-04 01:38:00 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2017-12-04 01:38:00 -0800 |
commit | c8dd4c513908568c68c2b30d49d0303bb764bf17 (patch) | |
tree | 5b62031bb0031fab4c70f34d1035f06b7c4f4115 /test | |
parent | 6389457ed2ef7af141a3723c3eb82a1cdc81293b (diff) |
Remove some unneeded and spammy logs
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/qps/client_sync.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index cb0945b05b..c61e621dc4 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -74,9 +74,6 @@ class SynchronousClient HistogramEntry entry; const bool thread_still_ok = ThreadFuncImpl(&entry, thread_idx); t->UpdateHistogram(&entry); - if (!thread_still_ok) { - gpr_log(GPR_ERROR, "Finishing client thread due to RPC error"); - } if (!thread_still_ok || ThreadCompleted()) { return; } @@ -170,6 +167,7 @@ class SynchronousStreamingClient : public SynchronousClient { std::vector<std::unique_ptr<StreamType>> stream_; // stream_mu_ is only needed when changing an element of stream_ or context_ std::vector<std::mutex> stream_mu_; + // use struct Bool rather than bool because vector<bool> is not concurrent struct Bool { bool val; Bool() : val(false) {} @@ -183,8 +181,11 @@ class SynchronousStreamingClient : public SynchronousClient { // don't set the value since the stream is failed and shouldn't be timed entry->set_status(s.error_code()); if (!s.ok()) { - gpr_log(GPR_ERROR, "Stream %" PRIuPTR " received an error %s", thread_idx, - s.error_message().c_str()); + std::lock_guard<std::mutex> l(stream_mu_[thread_idx]); + if (!shutdown_[thread_idx].val) { + gpr_log(GPR_ERROR, "Stream %" PRIuPTR " received an error %s", + thread_idx, s.error_message().c_str()); + } } // Lock the stream_mu_ now because the client context could change std::lock_guard<std::mutex> l(stream_mu_[thread_idx]); |