hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duo Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-19312) Find out why sometimes we need to spend more than one second to get the cluster id
Date Tue, 21 Nov 2017 05:27:00 GMT

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

Duo Zhang commented on HBASE-19312:

[~mdrob] hey curator committer, could you please explain this line?


            if ( !operationAndData.isConnectionRequired() || client.isConnected() )
                client.getZooKeeper();  // important - allow connection resets, timeouts,
etc. to occur
                if ( operationAndData.getElapsedTimeMs() >= client.getConnectionTimeoutMs()
                    throw new CuratorConnectionLossException();
                operationAndData.sleepFor(1, TimeUnit.SECONDS); // <===== here
Why there is a sleep if the client is not connected yet? In fact I do not want to block the
client thread so I do not call blockUntilConnected and use the asynchronous API of CuratorFramework(inBackground)
to get data. But sadly if the connection to zk is not established yet we will sleep 1 second

Is this intentional? If yes, then what is the correct way to write fully asynchronous code
with curator? Thanks.

> Find out why sometimes we need to spend more than one second to get the cluster id
> ----------------------------------------------------------------------------------
>                 Key: HBASE-19312
>                 URL: https://issues.apache.org/jira/browse/HBASE-19312
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Duo Zhang
> See the discussion in HBASE-19266.

This message was sent by Atlassian JIRA

View raw message