summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandreer <andreer@verizonmedia.com>2020-02-11 08:41:37 +0100
committerandreer <andreer@verizonmedia.com>2020-02-11 08:41:37 +0100
commit0649c71a473b6af8008af575cc5c82bd8179e43b (patch)
tree1acc573271946caf98cb2551715cb59568896a71
parentb943fb223658c0708356b5be861841d41ca2b5fd (diff)
log exceptions from backfill
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/endpointcertificates/EndpointCertificateManager.java23
1 files changed, 8 insertions, 15 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/endpointcertificates/EndpointCertificateManager.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/endpointcertificates/EndpointCertificateManager.java
index b702afe1647..74f43e39221 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/endpointcertificates/EndpointCertificateManager.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/endpointcertificates/EndpointCertificateManager.java
@@ -71,7 +71,13 @@ public class EndpointCertificateManager {
this.clock = clock;
this.useRefreshedEndpointCertificate = Flags.USE_REFRESHED_ENDPOINT_CERTIFICATE.bindTo(flagSource);
this.endpointCertificateBackfill = Flags.ENDPOINT_CERTIFICATE_BACKFILL.bindTo(flagSource);
- Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(this::backfillCertificateMetadata, 1, 10, TimeUnit.MINUTES);
+ Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate(() -> {
+ try {
+ this.backfillCertificateMetadata();
+ } catch (Exception e) {
+ log.log(LogLevel.INFO, "Unexpected exception while backfilling certificate metadata", e);
+ }
+ }, 1, 10, TimeUnit.MINUTES);
}
public Optional<EndpointCertificateMetadata> getEndpointCertificateMetadata(Instance instance, ZoneId zone) {
@@ -108,20 +114,7 @@ public class EndpointCertificateManager {
enum BackfillMode {
DISABLE,
DRYRUN,
- ENABLE;
-
- BackfillMode fromString(String backfillMode) {
- switch (backfillMode) {
- case "disable":
- return DISABLE;
- case "dryrun":
- return DRYRUN;
- case "enable":
- return ENABLE;
- default:
- throw new RuntimeException("Uknown backfill mode!");
- }
- }
+ ENABLE
}
private void backfillCertificateMetadata() {