hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-16238) It's useless to catch SESSIONEXPIRED exception and retry in RecoverableZooKeeper
Date Tue, 19 Jul 2016 03:51:20 GMT

    [ https://issues.apache.org/jira/browse/HBASE-16238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15383534#comment-15383534
] 

Hudson commented on HBASE-16238:
--------------------------------

FAILURE: Integrated in HBase-Trunk_matrix #1254 (See [https://builds.apache.org/job/HBase-Trunk_matrix/1254/])
HBASE-16238 It's useless to catch SESSIONEXPIRED exception and retry in (stack: rev c9925bcec1f5cd427c4a875dba64b92e3dafcc1e)
* hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/RecoverableZooKeeper.java


> It's useless to catch SESSIONEXPIRED exception and retry in RecoverableZooKeeper
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-16238
>                 URL: https://issues.apache.org/jira/browse/HBASE-16238
>             Project: HBase
>          Issue Type: Bug
>          Components: Zookeeper
>    Affects Versions: 1.1.5, 1.2.2, 0.98.20
>            Reporter: Allan Yang
>            Priority: Minor
>             Fix For: 1.3.0, 1.1.5, 1.2.2, 0.98.20
>
>         Attachments: HBASE-16238.patch, HBASE-16238v2.patch
>
>
> After HBASE-5549, SESSIONEXPIRED exception was caught and retried with other zookeeper
exceptions like ConnectionLoss. But it is useless to retry when a session expired happens,
since the retry will never be successful. Though there is a config called "zookeeper.recovery.retry"
to control retry times, in our cases, we set this config to a very big number like "99999".
When a session expired happens, the regionserver should kill itself, but because of the retrying,
threads of regionserver stuck at trying to reconnect to zookeeper, and never properly shut
down.
> {code}
> public Stat exists(String path, boolean watch)
>   throws KeeperException, InterruptedException {
>     TraceScope traceScope = null;
>     try {
>       traceScope = Trace.startSpan("RecoverableZookeeper.exists");
>       RetryCounter retryCounter = retryCounterFactory.create();
>       while (true) {
>         try {
>           return checkZk().exists(path, watch);
>         } catch (KeeperException e) {
>           switch (e.code()) {
>             case CONNECTIONLOSS:
>             case SESSIONEXPIRED: //we shouldn't catch this
>             case OPERATIONTIMEOUT:
>               retryOrThrow(retryCounter, e, "exists");
>               break;
>             default:
>               throw e;
>           }
>         }
>         retryCounter.sleepUntilNextRetry();
>       }
>     } finally {
>       if (traceScope != null) traceScope.close();
>     }
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message