summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2022-11-07 11:22:20 +0100
committerGitHub <noreply@github.com>2022-11-07 11:22:20 +0100
commit74f816012f3a580c7f42bbfe7d22feaed331891d (patch)
tree7015f5d79569c07ee1ac22e088aee047a808b250
parent8c5bd1f18639a34b52b32231c128adfe81e6a146 (diff)
parent1e88a32a15f78e68485fc1097cc2d06d3a099bc3 (diff)
Merge pull request #24774 from vespa-engine/hmusum/expire-remote-sessions-for-standalone-vespa-2
Reduce expiry time for remote sessions for self-hosted
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionRepository.java18
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);