diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-06-15 15:16:41 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2021-06-15 15:16:41 +0200 |
commit | 7aaceccd0a420cb862bf2adc0e06bcaec2dc35a4 (patch) | |
tree | b05b308463d25d6b794d282b20ccc7fe116fd1da /configserver | |
parent | cce288b700a108c9e643fdbfcf5c3d76645dbe48 (diff) |
Load local sessions only if enabled by flag
Loading local sessions should not be needed, everything should exist
as a remote session. Hide behind feature flag for now
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java index 6fcdd7b0995..41d050025bf 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java @@ -166,16 +166,17 @@ public class SessionRepository { this.configDefinitionRepo = configDefinitionRepo; this.rewriteSearchDefinitions = Flags.MOVE_SEARCH_DEFINITIONS_TO_SCHEMAS_DIR.bindTo(flagSource); - loadSessions(); // Needs to be done before creating cache below + loadSessions(Flags.LOAD_LOCAL_SESSIONS_WHEN_BOOTSTRAPPING.bindTo(flagSource)); // Needs to be done before creating cache below this.directoryCache = curator.createDirectoryCache(sessionsPath.getAbsolute(), false, false, zkCacheExecutor); this.directoryCache.addListener(this::childEvent); this.directoryCache.start(); } - private void loadSessions() { + private void loadSessions(BooleanFlag loadLocalSessions) { ExecutorService executor = Executors.newFixedThreadPool(Math.max(8, Runtime.getRuntime().availableProcessors()), new DaemonThreadFactory("load-sessions-")); - loadLocalSessions(executor); + if (loadLocalSessions.value()) + loadLocalSessions(executor); loadRemoteSessions(executor); try { executor.shutdown(); |