IMPALA-4892: Session ID included in error message Included the Session ID in the invalid session ID message.
Change-Id: I721951aaf2425da62e61d65150e462a83716b02e Reviewed-on: http://gerrit.cloudera.org:8080/7054 Reviewed-by: Henry Robinson <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/eea4ad7c Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/eea4ad7c Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/eea4ad7c Branch: refs/heads/master Commit: eea4ad7caa8cf6ab7cea125e9564392d63ea2c27 Parents: 5f9f704 Author: Steve C <[email protected]> Authored: Fri Jun 2 00:25:55 2017 +0000 Committer: Impala Public Jenkins <[email protected]> Committed: Fri Jun 9 03:39:38 2017 +0000 ---------------------------------------------------------------------- be/src/service/impala-hs2-server.cc | 6 ++++-- be/src/service/impala-server.cc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/eea4ad7c/be/src/service/impala-hs2-server.cc ---------------------------------------------------------------------- diff --git a/be/src/service/impala-hs2-server.cc b/be/src/service/impala-hs2-server.cc index ea8c624..6f50f64 100644 --- a/be/src/service/impala-hs2-server.cc +++ b/be/src/service/impala-hs2-server.cc @@ -124,7 +124,8 @@ void ImpalaServer::ExecuteMetadataOp(const THandleIdentifier& session_handle, if (session == NULL) { status->__set_statusCode(thrift::TStatusCode::ERROR_STATUS); - status->__set_errorMessage("Invalid session ID"); + status->__set_errorMessage(Substitute("Invalid session id: $0", + PrintId(session_id))); status->__set_sqlState(SQLSTATE_GENERAL_ERROR); return; } @@ -432,7 +433,8 @@ void ImpalaServer::ExecuteStatement(TExecuteStatementResp& return_val, SQLSTATE_GENERAL_ERROR); if (session == NULL) { HS2_RETURN_IF_ERROR( - return_val, Status("Invalid session ID"), SQLSTATE_GENERAL_ERROR); + return_val, Status(Substitute("Invalid session id: $0", + PrintId(session_id))), SQLSTATE_GENERAL_ERROR); } // Optionally enable result caching to allow restarting fetches. http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/eea4ad7c/be/src/service/impala-server.cc ---------------------------------------------------------------------- diff --git a/be/src/service/impala-server.cc b/be/src/service/impala-server.cc index 434220a..da432dc 100644 --- a/be/src/service/impala-server.cc +++ b/be/src/service/impala-server.cc @@ -1037,7 +1037,7 @@ Status ImpalaServer::CloseSessionInternal(const TUniqueId& session_id, if (ignore_if_absent) { return Status::OK(); } else { - return Status("Invalid session ID"); + return Status(Substitute("Invalid session id: $0", PrintId(session_id))); } } session_state = entry->second; @@ -1082,7 +1082,7 @@ Status ImpalaServer::GetSessionState(const TUniqueId& session_id, SessionStateMap::iterator i = session_state_map_.find(session_id); if (i == session_state_map_.end()) { *session_state = std::shared_ptr<SessionState>(); - return Status("Invalid session id"); + return Status(Substitute("Invalid session id: $0", PrintId(session_id))); } else { if (mark_active) { lock_guard<mutex> session_lock(i->second->lock);
