diff options
author | Harald Musum <musum@yahooinc.com> | 2023-10-10 12:03:55 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-10-10 12:03:55 +0200 |
commit | a8c5a3915b42eb1f2412b0a4824e285657e41351 (patch) | |
tree | 2689896c1ba6f22008ae0829e5f6a654e30bc170 /configserver | |
parent | 955b46e82a969ed722a008d84878518337803b74 (diff) |
Fallback to last activation time if we cannot find last deploy time
Also log application id if maintainer fails finding last deploy time
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java | 11 |
1 files changed, 9 insertions, 2 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 1aeaebafd84..a78eeb902c0 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 @@ -476,10 +476,17 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye .flatMap(ApplicationData::lastDeployedSession); if (lastDeployedSession.isEmpty()) return activationTime(application); - Instant createTime = getRemoteSession(tenant, lastDeployedSession.get()).getCreateTime(); + Optional<Instant> createTime; + try { + createTime = Optional.of(getRemoteSession(tenant, lastDeployedSession.get()).getCreateTime()); + } + catch (Exception e) { + // Fallback to activation time, e.g. when last deployment failed before writing session data for new session + createTime = activationTime(application); + } log.log(Level.FINEST, application + " last deployed " + createTime); - return Optional.of(createTime); + return createTime; } @Override |