apache / apache/curator

[CURATOR-355] Curator client fails when connecting to read-only ensemble

Open
#875 15 comments 0 reactions 0 assignees View on GitHub
bug imported-jira-issue
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

ZK is 3.5.1-alpha

I have a 3 nodes ZK cluster , readonly mode is enabled.

2 nodes are down, so one of them (QA-E8WIN11) is in read-only (verified by using the ZK API manually). All the machines of the ensemble can be pinged from the client.

I'm using this piece of code:


		Builder curatorClientBuilder = CuratorFrameworkFactory.builder()

.connectString("QA-E8WIN11:2181,QA-E8WIN12:2181")
.sessionTimeoutMs(45000).connectionTimeoutMs(15000)
.retryPolicy(new RetryNTimes(3, 5000)).canBeReadOnly(true);

CuratorFramework client = curatorClientBuilder.build();
client.start();
client.getZookeeperClient().blockUntilConnectedOrTimedOut();
System.out.println("Successfully established the connection with ZooKeeper");

client.getData().forPath("/");
System.out.println("Done.");


When curator pick the host that is UP first, it goes through very quickly. When it picks the host that is down first (QA-E8WIN12), it seems to be stuck at the getData() call for a very long time, and then eventually fail with a ConnectionLossException. (see attached log)

---
Originally reported by benjamin.jaton, imported from: Curator client fails when connecting to read-only ensemble


  • status: Open
  • priority: Critical
  • resolution: Unresolved
  • imported: 2025-01-21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.