diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-01-22 12:43:26 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2021-01-22 12:43:26 +0100 |
commit | 49bcbe1c6fca80b70d23b97221a019cf98e6ff89 (patch) | |
tree | 6c9ff9b010e5874aad6faeea94cbab91bf5ced99 /configserver/src | |
parent | fceb24fb967e9f67c6f2f29a9dd968f9107fa091 (diff) |
Do not synchronize on method used to bootstrap tenants
Diffstat (limited to 'configserver/src')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java | 9 |
1 files changed, 6 insertions, 3 deletions
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 15f30dc6ece..0d818204fd5 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 @@ -172,7 +172,7 @@ public class TenantRepository { this.hostRegistry = hostRegistry; this.configserverConfig = configserverConfig; this.bootstrapExecutor = Executors.newFixedThreadPool(configserverConfig.numParallelTenantLoaders(), - new DaemonThreadFactory("bootstrap tenants")); + new DaemonThreadFactory("bootstrap-tenants-")); this.curator = curator; this.metrics = metrics; metricUpdater = metrics.getOrCreateMetricUpdater(Collections.emptyMap()); @@ -286,7 +286,7 @@ public class TenantRepository { } // Use when bootstrapping an existing tenant based on ZooKeeper data - protected synchronized void bootstrapTenant(TenantName tenantName) { + protected void bootstrapTenant(TenantName tenantName) { createTenant(tenantName, readCreatedTimeFromZooKeeper(tenantName)); } @@ -306,6 +306,8 @@ public class TenantRepository { return tenant; } + Instant start = Instant.now(); + log.log(Level.FINE, "Adding tenant '" + tenantName); TenantApplications applicationRepo = new TenantApplications(tenantName, curator, @@ -346,7 +348,8 @@ public class TenantRepository { modelFactoryRegistry, configDefinitionRepo, tenantListener); - log.log(Level.INFO, "Adding tenant '" + tenantName + "'" + ", created " + created); + log.log(Level.INFO, "Adding tenant '" + tenantName + "'" + ", created " + created + + ". Bootstrapping in " + Duration.between(start, Instant.now())); Tenant tenant = new Tenant(tenantName, sessionRepository, applicationRepo, applicationRepo, created); notifyNewTenant(tenant); tenants.putIfAbsent(tenantName, tenant); |