You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by mi...@apache.org on 2017/12/01 16:01:52 UTC

[3/4] impala git commit: IMPALA-5940: Avoid stack tracing and log spew with Status::Expected()

IMPALA-5940: Avoid stack tracing and log spew with Status::Expected()

This change converts some callers of Status() to Status::Expected()
in the DataStreamMgr to avoid log spew and unnecessary overhead of
stack tracing.

Change-Id: Ie1f7d16e60f7859d662e87642d0f82e1d74183ad
Reviewed-on: http://gerrit.cloudera.org:8080/8689
Reviewed-by: Bharath Vissapragada <bh...@cloudera.com>
Reviewed-by: Dan Hecht <dh...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/0a0be171
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/0a0be171
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/0a0be171

Branch: refs/heads/master
Commit: 0a0be17102981e7874c6396c42f56e0be8286069
Parents: 9560d88
Author: Michael Ho <kw...@cloudera.com>
Authored: Wed Nov 29 14:28:04 2017 -0800
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Thu Nov 30 23:34:35 2017 +0000

----------------------------------------------------------------------
 be/src/runtime/data-stream-mgr.cc      | 21 ++++++++++++++-------
 be/src/runtime/krpc-data-stream-mgr.cc |  9 +++++----
 2 files changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/0a0be171/be/src/runtime/data-stream-mgr.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/data-stream-mgr.cc b/be/src/runtime/data-stream-mgr.cc
index 9af8384..503cd29 100644
--- a/be/src/runtime/data-stream-mgr.cc
+++ b/be/src/runtime/data-stream-mgr.cc
@@ -185,8 +185,10 @@ Status DataStreamMgr::AddData(const TUniqueId& fragment_instance_id,
     // and there's no unexpected error here. If already_unregistered is false,
     // FindRecvrOrWait() timed out, which is unexpected and suggests a query setup error;
     // we return DATASTREAM_SENDER_TIMEOUT to trigger tear-down of the query.
-    return already_unregistered ? Status::OK() :
-        Status(TErrorCode::DATASTREAM_SENDER_TIMEOUT, PrintId(fragment_instance_id));
+    if (already_unregistered) return Status::OK();
+    ErrorMsg msg(TErrorCode::DATASTREAM_SENDER_TIMEOUT, PrintId(fragment_instance_id));
+    VLOG_QUERY << "DataStreamMgr::AddData(): " << msg.msg();
+    return Status::Expected(msg);
   }
   DCHECK(!already_unregistered);
   recvr->AddBatch(thrift_batch, sender_id);
@@ -202,11 +204,16 @@ Status DataStreamMgr::CloseSender(const TUniqueId& fragment_instance_id,
   shared_ptr<DataStreamRecvr> recvr = FindRecvrOrWait(fragment_instance_id, dest_node_id,
       &already_unregistered);
   if (recvr == nullptr) {
-    // Was not able to notify the receiver that this was the end of stream. Notify the
-    // sender that this failed so that they can take appropriate action (i.e. failing
-    // the query).
-    status = already_unregistered ? Status::OK() :
-        Status(TErrorCode::DATASTREAM_SENDER_TIMEOUT, PrintId(fragment_instance_id));
+    if (already_unregistered) {
+      status = Status::OK();
+    } else {
+      // Was not able to notify the receiver that this was the end of stream. Notify the
+      // sender that this failed so that they can take appropriate action (i.e. failing
+      // the query).
+      ErrorMsg msg(TErrorCode::DATASTREAM_SENDER_TIMEOUT, PrintId(fragment_instance_id));
+      VLOG_QUERY << "DataStreamMgr::CloseSender(): " << msg.msg();
+      status = Status::Expected(msg);
+    }
   } else {
     recvr->RemoveSender(sender_id);
   }

http://git-wip-us.apache.org/repos/asf/impala/blob/0a0be171/be/src/runtime/krpc-data-stream-mgr.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/krpc-data-stream-mgr.cc b/be/src/runtime/krpc-data-stream-mgr.cc
index b70bca6..7c36191 100644
--- a/be/src/runtime/krpc-data-stream-mgr.cc
+++ b/be/src/runtime/krpc-data-stream-mgr.cc
@@ -198,8 +198,8 @@ void KrpcDataStreamMgr::AddData(const TransmitDataRequestPB* request,
     // FindRecvr() may return nullptr even though the receiver was once present. We
     // detect this case by checking already_unregistered - if true then the receiver was
     // already closed deliberately, and there's no unexpected error here.
-    Status(TErrorCode::DATASTREAM_RECVR_CLOSED, PrintId(finst_id), dest_node_id)
-        .ToProto(response->mutable_status());
+    ErrorMsg msg(TErrorCode::DATASTREAM_RECVR_CLOSED, PrintId(finst_id), dest_node_id);
+    Status::Expected(msg).ToProto(response->mutable_status());
     rpc_context->RespondSuccess();
     return;
   }
@@ -335,8 +335,9 @@ void KrpcDataStreamMgr::RespondToTimedOutSender(const std::unique_ptr<ContextTyp
   finst_id.__set_lo(request->dest_fragment_instance_id().lo());
   finst_id.__set_hi(request->dest_fragment_instance_id().hi());
 
-  Status(TErrorCode::DATASTREAM_SENDER_TIMEOUT, PrintId(finst_id)).ToProto(
-      ctx->response->mutable_status());
+  ErrorMsg msg(TErrorCode::DATASTREAM_SENDER_TIMEOUT, PrintId(finst_id));
+  VLOG_QUERY << msg.msg();
+  Status::Expected(msg).ToProto(ctx->response->mutable_status());
   ctx->rpc_context->RespondSuccess();
   num_senders_waiting_->Increment(-1);
   num_senders_timedout_->Increment(1);