aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-11-27 12:09:41 +0100
committerHarald Musum <musum@verizonmedia.com>2020-11-27 12:09:41 +0100
commitd971c712477246b5562661cdd12c0a01a1141e0a (patch)
treeec3686595c6fe45006ab2226053bed315927c0e7 /configserver
parent1677b17dd4483843f9b8507c199bd496b2d03389 (diff)
Get data for some event types only, for others data might be null
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java7
1 files changed, 3 insertions, 4 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 75a981f1a17..5a34217dbdd 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
@@ -186,18 +186,17 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica
private void childEvent(CuratorFramework ignored, PathChildrenCacheEvent event) {
zkWatcherExecutor.execute(() -> {
- ChildData data = event.getData();
- if (data == null) return; // Node might have been deleted after we got event
- ApplicationId applicationId = ApplicationId.fromSerializedForm(Path.fromString(data.getPath()).getName());
+ // Note: event.getData() might return null on types not handled here (CONNECTION_*, INITIALIZED, see javadoc)
switch (event.getType()) {
case CHILD_ADDED:
/* A new application is added when a session is added, @see
{@link com.yahoo.vespa.config.server.session.SessionRepository#childEvent(CuratorFramework, PathChildrenCacheEvent)} */
+ ApplicationId applicationId = ApplicationId.fromSerializedForm(Path.fromString(event.getData().getPath()).getName());
log.log(Level.FINE, TenantRepository.logPre(applicationId) + "Application added: " + applicationId);
break;
// Event CHILD_REMOVED will be triggered on all config servers if deleteApplication() above is called on one of them
case CHILD_REMOVED:
- removeApplication(applicationId);
+ removeApplication(ApplicationId.fromSerializedForm(Path.fromString(event.getData().getPath()).getName()));
break;
case CHILD_UPDATED:
// do nothing, application just got redeployed