diff --git a/docs/src/main/asciidoc/se/fault-tolerance.adoc b/docs/src/main/asciidoc/se/fault-tolerance.adoc index 86dc63b254e..89008d8f2c0 100644 --- a/docs/src/main/asciidoc/se/fault-tolerance.adoc +++ b/docs/src/main/asciidoc/se/fault-tolerance.adoc @@ -277,7 +277,7 @@ the application developer or automatically by the API. |=== ^|Name ^|Tags ^|Description |ft.bulkhead.calls.total | name="" | Counter for all calls entering a bulkhead -|ft.bulkhead.waitingDuration | name="" | Histogram of waiting times to enter a bulkhead +|ft.bulkhead.waitingDuration | name="" | Distribution summary of waiting times to enter a bulkhead |ft.bulkhead.executionsRunning | name="" | Gauge whose value is the number of executions running in a bulkhead |ft.bulkhead.executionsWaiting | name="" | Gauge whose value is the number of executions waiting in a bulkhead |=== @@ -304,7 +304,7 @@ closed to open state |=== ^|Name ^|Tags ^|Description |ft.timeout.calls.total | name="" | Counter for all calls entering a timeout -|ft.timeout.executionDuration | name="" | Histogram of all execution durations in a timeout +|ft.timeout.executionDuration | name="" | Distribution summary of all execution durations in a timeout |=== === Enabling Metrics Programmatically diff --git a/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/Bulkhead.java b/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/Bulkhead.java index 13461bf165d..2da653f89c1 100644 --- a/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/Bulkhead.java +++ b/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/Bulkhead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2025 Oracle and/or its affiliates. + * Copyright (c) 2020, 2025 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/TimeoutImpl.java b/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/TimeoutImpl.java index 16fb2e8a68c..3bfe63310e3 100644 --- a/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/TimeoutImpl.java +++ b/fault-tolerance/fault-tolerance/src/main/java/io/helidon/faulttolerance/TimeoutImpl.java @@ -74,15 +74,15 @@ public T invoke(Supplier supplier) { long start = metricsEnabled ? System.nanoTime() : 0L; if (!currentThread) { try { - T res = CompletableFuture.supplyAsync(supplier, executor) + return CompletableFuture.supplyAsync(supplier, executor) .orTimeout(timeoutMillis, TimeUnit.MILLISECONDS) .get(); + } catch (Throwable t) { + throw mapThrowable(t, null); + } finally { if (metricsEnabled) { executionDurationMetric.record(System.nanoTime() - start, TimeUnit.NANOSECONDS); } - return res; - } catch (Throwable t) { - throw mapThrowable(t, null); } } else { Thread thisThread = Thread.currentThread();