diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-01-21 14:23:33 +0100 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-01-21 14:23:33 +0100 |
commit | 8fbace7e7541d3511c2962c6b1aed4c8ad51c7a4 (patch) | |
tree | a51e97048d04e17fb65697bf0144f87ddbae2440 /configserver | |
parent | cef5a82d3ed2c1a9d076d8cbd7c7e9b35ef75b0d (diff) |
Handle expections when finding file references to delete
If we get an exception when getting file references to delete catch
exception and continue with other applications, as we want to make
sure this is done even in case of some (transient) failure
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java | 13 |
1 files changed, 10 insertions, 3 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 7ee6febfac1..a5eb2b19421 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 @@ -426,12 +426,19 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye Set<String> fileReferencesInUse = new HashSet<>(); // Intentionally skip applications that we for some reason do not find + // or that we fail to get file references for (they will be retried on the next run) listApplications().stream() .map(this::getOptionalApplication) .map(Optional::get) - .forEach(application -> fileReferencesInUse.addAll(application.getModel().fileReferences().stream() - .map(FileReference::value) - .collect(Collectors.toSet()))); + .forEach(application -> { + try { + fileReferencesInUse.addAll(application.getModel().fileReferences().stream() + .map(FileReference::value) + .collect(Collectors.toSet())); + } catch (Exception e) { + log.log(LogLevel.WARNING, "Getting file references in use from : " + application + " failed", e); + } + }); log.log(LogLevel.DEBUG, "File references in use : " + fileReferencesInUse); // Find those on disk that are not in use |