Details
Description
This sequence is not working:
// ZK servers are not started here
ExponentialBackoffRetry retryPolicy = new ExponentialBackoffRetry(1000, 1, 2000);
CuratorFramework zkClient = CuratorFrameworkFactory.newClient("127.0.0.1:30101",
4500,
4500,
retryPolicy);
zkClient.start();
Thread.sleep(2000);
PersistentEphemeralNode pen = new PersistentEphemeralNode(zkClient, Mode.EPHEMERAL, "/abc/pen", "hello".getBytes());
Thread.sleep(2000);
// Start ZK servers here
Thread.sleep(2000);
// "/abc/pen" ephemeral node is not created
It is expected that once the CuratorFrameowrk is connected the ephemeral node is created
I attach a program that shows the failure