Claus Ibsen created CAMEL-27826:
-----------------------------------

             Summary: camel-zookeeper: a listChildren consumer stops when the 
znode is deleted, the producer lists the children of the wrong path
                 Key: CAMEL-27826
                 URL: https://issues.apache.org/jira/browse/CAMEL-27826
             Project: Camel
          Issue Type: Bug
          Components: camel-zookeeper
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-zookeeper for 
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31141).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. A listChildren consumer stops for good when the znode is deleted
{{ChildrenChangedOperation}} waits only for NodeChildrenChanged. Deleting the 
watched znode fires the getChildren watch with NodeDeleted, which is ignored; 
the watch is used up and the OperationsExecutor thread waits forever, also when 
the znode is created again.
Proposed change: also wait for NodeDeleted and return null for it, so that with 
repeat the sequence goes back to waiting for the znode to exist.

h4. 2. The producer lists the children of the endpoint path
{{ZooKeeperProducer}} with listChildren on an InOut exchange lists the children 
of configuration.getPath(), not of the znode in the CamelZooKeeperNode header.
Proposed change: use the node of the exchange.

h4. 3. copy() shares the servers list
{{ZooKeeperConfiguration.copy()}} is a shallow clone. When a component-level 
configuration has servers set (Java), each createEndpoint adds the URI hosts to 
that same list, so the connect strings grow and mix hosts.
Proposed change: copy the servers list.

h4. 4. Smaller problems
An unknown createMode (option or header) falls back to EPHEMERAL without a 
warning (empty catch in ZooKeeperProducer.createNode and ZooKeeperUtils). 
ConnectionHolder waits for the connection with latch.await() and no time limit, 
so the start blocks forever when no server can be reached.
Proposed change: warn or fail on an unknown mode; wait with a time limit.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to