diff options
author | gjoranv <gv@verizonmedia.com> | 2020-07-06 10:30:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-06 10:30:10 +0200 |
commit | 95bffbc79c4cce00c33fec07e07e4c9fb408d013 (patch) | |
tree | cd674e87dcafc44790789878a5b4b6078c184e31 | |
parent | 475bd34f0c56bb6d59ae6f5bb7c12092dc6819f4 (diff) | |
parent | 1ae129d887a3cc3b09b0149f530ce19fe95cf7ee (diff) |
Merge pull request #13803 from vespa-engine/hmusum/add-listener-before-starting-curator-directory-cache
Add listener before starting curator directory cache
2 files changed, 2 insertions, 2 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java index 638e3565602..2136906f205 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java @@ -87,8 +87,8 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica this.tenant = tenant; this.zkWatcherExecutor = command -> zkWatcherExecutor.execute(tenant, command); this.directoryCache = curator.createDirectoryCache(applicationsPath.getAbsolute(), false, false, zkCacheExecutor); - this.directoryCache.start(); this.directoryCache.addListener(this::childEvent); + this.directoryCache.start(); this.metrics = metrics; this.reloadListener = reloadListener; this.responseFactory = ConfigResponseFactory.create(configserverConfig); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java index 33ce8f52834..e7888f2663b 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java @@ -118,8 +118,8 @@ public class TenantRepository { if (useZooKeeperWatchForTenantChanges) { this.directoryCache = Optional.of(curator.createDirectoryCache(tenantsPath.getAbsolute(), false, false, zkCacheExecutor)); - this.directoryCache.get().start(); this.directoryCache.get().addListener(this::childEvent); + this.directoryCache.get().start(); } else { this.directoryCache = Optional.empty(); } |