hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-4973) On failure, HBaseAdmin sleeps one time too many
Date Fri, 09 Dec 2011 09:23:41 GMT

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

Hudson commented on HBASE-4973:
-------------------------------

Integrated in HBase-TRUNK #2532 (See [https://builds.apache.org/job/HBase-TRUNK/2532/])
    HBASE-4973 On failure, HBaseAdmin sleeps one time too many

stack : 
Files : 
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java

                
> On failure, HBaseAdmin sleeps one time too many
> -----------------------------------------------
>
>                 Key: HBASE-4973
>                 URL: https://issues.apache.org/jira/browse/HBASE-4973
>             Project: HBase
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.94.0
>            Reporter: nkeywal
>            Assignee: nkeywal
>            Priority: Minor
>             Fix For: 0.94.0
>
>         Attachments: 4973_HBaseAdmin.patch
>
>
> In this code last sleep is useless as we're not retrying. This can slow down failure
scenarios by a few seconds (up to 32 second).
> {noformat}
>   public HBaseAdmin(Configuration c)
>   throws MasterNotRunningException, ZooKeeperConnectionException {
>     this.conf = HBaseConfiguration.create(c);
>       this.connection = HConnectionManager.getConnection(this.conf);
>     this.pause = this.conf.getLong("hbase.client.pause", 1000);
>     this.numRetries = this.conf.getInt("hbase.client.retries.number", 10);
>     this.retryLongerMultiplier = this.conf.getInt(
>         "hbase.client.retries.longer.multiplier", 10);
>     int tries = 0;
>     for (; tries < numRetries; ++tries) {
>       try {
>         this.connection.getMaster();
>         break;
>       } catch (MasterNotRunningException mnre) {
>         HConnectionManager.deleteStaleConnection(this.connection);
>         this.connection = HConnectionManager.getConnection(this.conf);
>       } catch (UndeclaredThrowableException ute) {
>         HConnectionManager.deleteStaleConnection(this.connection);
>         this.connection = HConnectionManager.getConnection(this.conf);
>       }
>       try { // Sleep
>         Thread.sleep(getPauseTime(tries));
>       } catch (InterruptedException e) {
>         Thread.currentThread().interrupt();
>         // we should delete connection between client and zookeeper
>         HConnectionManager.deleteStaleConnection(this.connection);
>         throw new MasterNotRunningException("Interrupted");
>       }
>     }
>     if (tries >= numRetries) {
>       // we should delete connection between client and zookeeper
>       HConnectionManager.deleteStaleConnection(this.connection);
>       throw new MasterNotRunningException("Retried " + numRetries + " times");
>     }
>   }
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message