summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-01-21 22:53:39 +0100
committerHarald Musum <musum@verizonmedia.com>2020-01-21 22:53:39 +0100
commitc77d23f9875ed8f53519dca0f4ad2585ed8ca7b9 (patch)
tree23bdc4e2881681c4027234c3faa25eb349aebe67 /configserver
parent8fbace7e7541d3511c2962c6b1aed4c8ad51c7a4 (diff)
Catch exception also when trying to get application
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java23
1 files changed, 11 insertions, 12 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 a5eb2b19421..9625547771e 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
@@ -427,18 +427,17 @@ 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 -> {
- 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);
- }
- });
+ for (var application : listApplications()) {
+ try {
+ Optional<Application> app = getOptionalApplication(application);
+ if (app.isEmpty()) continue;
+ fileReferencesInUse.addAll(app.get().getModel().fileReferences().stream()
+ .map(FileReference::value)
+ .collect(Collectors.toSet()));
+ } catch (Exception e) {
+ log.log(LogLevel.WARNING, "Getting file references in use for '" + application + "' failed", e);
+ }
+ }
log.log(LogLevel.DEBUG, "File references in use : " + fileReferencesInUse);
// Find those on disk that are not in use