From c8dd4c513908568c68c2b30d49d0303bb764bf17 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Mon, 4 Dec 2017 01:38:00 -0800 Subject: Remove some unneeded and spammy logs --- test/cpp/qps/client_sync.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/cpp/qps') 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> stream_; // stream_mu_ is only needed when changing an element of stream_ or context_ std::vector stream_mu_; + // use struct Bool rather than bool because vector 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 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 l(stream_mu_[thread_idx]); -- cgit v1.2.3