diff options
author | Harald Musum <musum@yahooinc.com> | 2022-11-07 11:13:10 +0100 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2022-11-07 11:13:10 +0100 |
commit | 1e88a32a15f78e68485fc1097cc2d06d3a099bc3 (patch) | |
tree | 2db2a58d93c7a5cadabc26da2350e1028157ae57 /configserver | |
parent | a2eca5f54c45838d072f9641505baa3ae0d26746 (diff) |
Reduce expiry time for remote sessions for self-hosted
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java | 18 |
1 files changed, 1 insertions, 17 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 b36e8d2d37c..d05640ef818 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 @@ -216,19 +216,6 @@ public class SessionRepository { return List.copyOf(localSessionCache.values()); } - public Set<LocalSession> getLocalSessionsFromFileSystem() { - File[] sessions = tenantFileSystemDirs.sessionsPath().listFiles(sessionApplicationsFilter); - if (sessions == null) return Set.of(); - - Set<LocalSession> sessionIds = new HashSet<>(); - for (File session : sessions) { - long sessionId = Long.parseLong(session.getName()); - LocalSession localSession = getSessionFromFile(sessionId); - sessionIds.add(localSession); - } - return sessionIds; - } - private LocalSession getSessionFromFile(long sessionId) { SessionZooKeeperClient sessionZKClient = createSessionZooKeeperClient(sessionId); File sessionDir = getAndValidateExistingSessionAppDir(sessionId); @@ -377,10 +364,7 @@ public class SessionRepository { } public int deleteExpiredRemoteSessions(Clock clock) { - Duration expiryTime = configserverConfig.hostedVespa() - ? sessionLifetime.multipliedBy(2) - : sessionLifetime.multipliedBy(12); // TODO: Remove when tested more (Oct. 2022 at the latest) - + Duration expiryTime = sessionLifetime.multipliedBy(2); List<Long> remoteSessionsFromZooKeeper = getRemoteSessionsFromZooKeeper(); log.log(Level.FINE, () -> "Remote sessions for tenant " + tenantName + ": " + remoteSessionsFromZooKeeper); |