summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2021-04-22 14:42:58 +0200
committerGitHub <noreply@github.com>2021-04-22 14:42:58 +0200
commitb78b2fb27c27fd744227b7181862a00fee133319 (patch)
tree0e70539d114a998b6f44b5059de8ff5258649519 /configserver
parent5667d6d05eba7ecee06ff39228b92cc62984069d (diff)
parent4d4c1310f472bf01c36f0ae5bf658c8b5fa8f44d (diff)
Merge pull request #17518 from vespa-engine/hmusum/dont-load-application-when-getting-application-just-return-not-found
Just return not found if application not loaded
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
index cc9d88f3fc9..7bb7656407f 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
@@ -656,10 +656,12 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
try {
Tenant tenant = getTenant(applicationId);
if (tenant == null) throw new NotFoundException("Tenant '" + applicationId.tenant() + "' not found");
- long sessionId = getSessionIdForApplication(tenant, applicationId);
- RemoteSession session = getRemoteSession(tenant, sessionId);
- SessionRepository sessionRepository = tenant.getSessionRepository();
- return sessionRepository.ensureApplicationLoaded(session).getForVersionOrLatest(version, clock.instant());
+
+ Optional<ApplicationSet> activeApplicationSet = tenant.getSessionRepository().getActiveApplicationSet(applicationId);
+ if (activeApplicationSet.isPresent())
+ return activeApplicationSet.get().getForVersionOrLatest(version, clock.instant());
+ else
+ throw new NotFoundException("Unknown application id '" + applicationId + "'");
} catch (NotFoundException e) {
log.log(Level.WARNING, "Failed getting application for '" + applicationId + "': " + e.getMessage());
throw e;