From 0b925dd12b350c563fa405a38bafd99ab8070340 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Wed, 21 Aug 2024 20:14:43 +0200 Subject: [PATCH] Return empty log for 3 minutes (was 2 minutes) if not found Avoid log noise --- .../com/yahoo/vespa/config/server/http/LogRetriever.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/LogRetriever.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/LogRetriever.java index c7469a30c447..3b185f903557 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/LogRetriever.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/LogRetriever.java @@ -24,15 +24,18 @@ public class LogRetriever { .socketTimeout(Timeout.ofSeconds(45)) .buildClient(); + /** + * Fetches logs from the log server for a given application. + * An empty response will be returned if we are unable to fetch logs and + * the deployment is less than 3 minutes old + */ @SuppressWarnings("deprecation") public HttpResponse getLogs(HttpURL logServerUri, Optional deployTime) { HttpGet get = new HttpGet(logServerUri.asURI()); try { return new ProxyResponse(httpClient.execute(get)); } catch (IOException e) { - // It takes some time before nodes are up after first-time deployment, return empty log for up to 2 minutes - // if getting logs fail - if (deployTime.isPresent() && Instant.now().isBefore(deployTime.get().plus(Duration.ofMinutes(2)))) + if (deployTime.isPresent() && Instant.now().isBefore(deployTime.get().plus(Duration.ofMinutes(3)))) return new EmptyResponse(); throw new RuntimeException("Failed to get logs from " + logServerUri, e);