This is an automated email from the ASF dual-hosted git repository.

prasanthj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new c0a9ebd  HIVE-21825: Improve client error msg when Active/Passive HA 
is enabled (Richard Zhang reviewed by Prasanth Jayachandran)
c0a9ebd is described below

commit c0a9ebdf23209b8a868c6a55ec91c974de9fe667
Author: Richard Zhang <rizh...@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());

Reply via email to