You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by pr...@apache.org on 2019/06/24 18:55:28 UTC
[hive] 02/02: HIVE-21825: Improve client error msg when
Active/Passive HA is enabled (Richard Zhang reviewed by Prasanth
Jayachandran)
This is an automated email from the ASF dual-hosted git repository.
prasanthj pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git
commit 36c29cbcec2d80ddda8f95537a636ad2c2b73a31
Author: Richard Zhang <ri...@cloudera.com>
AuthorDate: Mon Jun 24 11:50:21 2019 -0700
HIVE-21825: Improve client error msg when Active/Passive HA is enabled (Richard Zhang reviewed by Prasanth Jayachandran)
---
.../java/org/apache/hive/service/cli/session/SessionManager.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/service/src/java/org/apache/hive/service/cli/session/SessionManager.java b/service/src/java/org/apache/hive/service/cli/session/SessionManager.java
index 694a691..277519c 100644
--- a/service/src/java/org/apache/hive/service/cli/session/SessionManager.java
+++ b/service/src/java/org/apache/hive/service/cli/session/SessionManager.java
@@ -65,7 +65,11 @@ import org.slf4j.LoggerFactory;
public class SessionManager extends CompositeService {
private static final String INACTIVE_ERROR_MESSAGE =
- "Cannot open sessions on an inactive HS2 instance; use service discovery to connect";
+ "Cannot open sessions on an inactive HS2 instance, " +
+ "or the HS2 server leader is not ready; please use service discovery to " +
+ "connect the server leader again";
+ private static final String FAIL_CLOSE_ERROR_MESSAGE="Cannot close the session opened " +
+ "during the HA state change time";
public static final String HIVERCFILE = ".hiverc";
private static final Logger LOG = LoggerFactory.getLogger(CompositeService.class);
private HiveConf hiveConf;
@@ -478,7 +482,7 @@ public class SessionManager extends CompositeService {
} catch (Exception e) {
LOG.warn("Failed to close the session opened during an HA state change; ignoring", e);
}
- throw new HiveSQLException(INACTIVE_ERROR_MESSAGE);
+ throw new HiveSQLException(FAIL_CLOSE_ERROR_MESSAGE);
}
LOG.info("Session opened, " + session.getSessionHandle()
+ ", current sessions:" + getOpenSessionCount());