Thursday, April 21, 2022

[FIXED] what is difference between connection timeout and session timeout in curator

Issue

when we create a curator client, we have

    RetryPolicy retryPolicy = new RetryNTimes(3, 1000);
    CuratorFramework client = CuratorFrameworkFactory.newClient(zkConnectString, 
            15000, // sessionTimeoutMs
            15000, // connectionTimeoutMs
            retryPolicy);

Can someone tell what is difference between session timeout and connection timeout in the above api call?

Thank you


Solution

You cannot make API calls to ZooKeeper until the connection has been established (i.e. until you get SyncConnected). Curator internally waits until this connection has been established for you. connectionTimeoutMs is the max time to wait for this.



Answered By - Randgalt
Answer Checked By - Marilyn (PHPFixing Volunteer)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.