diff options
author | Andreas Eriksen <andreer@verizonmedia.com> | 2020-02-11 09:03:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 09:03:35 +0100 |
commit | b64ffc518680be2b5785dd14a247a8f20e8edde7 (patch) | |
tree | fb3bb0e022dfc3581fa6f26e7e1161fe86553a35 | |
parent | b943fb223658c0708356b5be861841d41ca2b5fd (diff) | |
parent | c4affd3e749489499031e639c091945be3625eac (diff) |
Merge pull request #12142 from vespa-engine/andreer/log-exceptions-from-backfill
log exceptions from backfill
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/endpointcertificates/EndpointCertificateManager.java | 23 |
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..071c1217b14 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 (Throwable t) { + log.log(LogLevel.INFO, "Unexpected Throwable caught while backfilling certificate metadata", t); + } + }, 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() { |