diff --git a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java index cb978929241..ddfb48a69f4 100644 --- a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java +++ b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java @@ -292,7 +292,7 @@ protected boolean isMatch(URL subscribeUrl, URL providerUrl) { private class RegistryChildListenerImpl implements ChildListener { private RegistryNotifier notifier; private long lastExecuteTime; - private CountDownLatch latch; + private volatile CountDownLatch latch; public RegistryChildListenerImpl(URL consumerUrl, String path, NotifyListener listener, CountDownLatch latch) { this.latch = latch;