Skip to content

Commit f39ad6f

Browse files
committed
ZKMetadataStore: Ignore the event for root node
Turns out Linux emits a `node created` event for the node a bit later. Therefore, even if we add a listened after creating a root node, we still may catch it in the listener
1 parent 878f8cd commit f39ad6f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spring-integration-zookeeper/src/main/java/org/springframework/integration/zookeeper/metadata/ZookeeperMetadataStore.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ public void event(Type type, ChildData oldData, ChildData newData) {
315315
ChildData data = Type.NODE_DELETED.equals(type) ? oldData : newData;
316316
String eventPath = data.getPath();
317317
String eventKey = getKey(eventPath);
318+
if (ZookeeperMetadataStore.this.root.equals(eventKey)) {
319+
// Ignore the root node for metadata tree
320+
return;
321+
}
318322
String value = IntegrationUtils.bytesToString(data.getData(), ZookeeperMetadataStore.this.encoding);
319323

320324
switch (type) {

0 commit comments

Comments
 (0)