From cdbc98f63ec674317fd1de87dc81a49a1b38a0f5 Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Tue, 10 Aug 2021 16:40:06 +0200 Subject: Avoid closing stderr --- .../src/main/java/ai/vespa/feed/client/CliClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vespa-feed-client-cli/src/main/java/ai/vespa/feed/client/CliClient.java b/vespa-feed-client-cli/src/main/java/ai/vespa/feed/client/CliClient.java index 768cdf4c171..bb0bf35dbce 100644 --- a/vespa-feed-client-cli/src/main/java/ai/vespa/feed/client/CliClient.java +++ b/vespa-feed-client-cli/src/main/java/ai/vespa/feed/client/CliClient.java @@ -68,7 +68,7 @@ public class CliClient { } } catch (InterruptedException | IOException ignored) { } // doesn't happen - }); + }, "progress-printer"); progressPrinter.setDaemon(true); progressPrinter.start(); } @@ -152,7 +152,7 @@ public class CliClient { } static void printBenchmarkResult(long durationNanos, OperationStats stats, OutputStream systemOut) throws IOException { - JsonFactory factory = new JsonFactory(); + JsonFactory factory = new JsonFactory().disable(JsonGenerator.Feature.AUTO_CLOSE_TARGET); long okCount = stats.successes(); long errorCount = stats.requests() - okCount; double throughput = okCount * 1e9 / Math.max(1, durationNanos); -- cgit v1.2.3 From aa47fadc15fe374006ee81bc16a6ff986b12940e Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Tue, 10 Aug 2021 16:40:19 +0200 Subject: Log more verbosely and on higher level from circuit breaker --- .../main/java/ai/vespa/feed/client/GracePeriodCircuitBreaker.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/GracePeriodCircuitBreaker.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/GracePeriodCircuitBreaker.java index c319bfca252..814d0283140 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/GracePeriodCircuitBreaker.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/GracePeriodCircuitBreaker.java @@ -9,6 +9,7 @@ import java.util.logging.Logger; import static java.util.Objects.requireNonNull; import static java.util.logging.Level.FINE; +import static java.util.logging.Level.INFO; import static java.util.logging.Level.WARNING; /** @@ -60,10 +61,13 @@ public class GracePeriodCircuitBreaker implements FeedClient.CircuitBreaker { public State state() { long failingMillis = clock.getAsLong() - failingSinceMillis.get(); if (failingMillis > graceMillis && halfOpen.compareAndSet(false, true)) - log.log(FINE, "Circuit breaker is now half-open"); + log.log(INFO, "Circuit breaker is now half-open, as no requests have succeeded for the " + + "last " + failingMillis + "ms. The server will be pinged to see if it recovers, " + + "but this client will give up if no successes are observed within " + doomMillis + "ms"); if (failingMillis > doomMillis && open.compareAndSet(false, true)) - log.log(WARNING, "Circuit breaker is now open"); + log.log(WARNING, "Circuit breaker is now open, after " + doomMillis + "ms of failing request, " + + "and this client will give up and abort its remaining feed operations."); return open.get() ? State.OPEN : halfOpen.get() ? State.HALF_OPEN : State.CLOSED; } -- cgit v1.2.3