diff options
author | Harald Musum <musum@verizonmedia.com> | 2023-10-10 13:06:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-10 13:06:51 +0200 |
commit | 69263495d5a827cd230e4ffd832747334f15a037 (patch) | |
tree | e5f4e606ee12e68ab85fe2dc40825bda29e47d20 /configserver | |
parent | 2f635d64e4ba166db3b15854cc0339e0bcdb2f3d (diff) | |
parent | a8c5a3915b42eb1f2412b0a4824e285657e41351 (diff) |
Merge pull request #28848 from vespa-engine/hmusum/log-application-id-when-failing-to-find-last-deploy-time
Fallback to last activation time if we cannot find 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 975b7fa08e4..2680b4babb1 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 |