diff options
author | Håkon Hallingstad <hakon@oath.com> | 2018-11-01 23:57:14 +0100 |
---|---|---|
committer | Håkon Hallingstad <hakon@oath.com> | 2018-11-01 23:57:14 +0100 |
commit | ddd668831dd89d6a6d5cc89203c6acbf1d00032c (patch) | |
tree | 7263e95ec856d05da04a6ac7fd9622d10c451ac3 /jaxrs_client_utils | |
parent | 23f8367787ac42870bd49b2d633f7c8b872c2695 (diff) |
Wrap CC HTTP failures in 409
Diffstat (limited to 'jaxrs_client_utils')
-rw-r--r-- | jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/JaxRsTimeouts.java | 4 | ||||
-rw-r--r-- | jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/JaxRsTimeouts.java b/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/JaxRsTimeouts.java index 6758d6f94d6..914a9d7b42c 100644 --- a/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/JaxRsTimeouts.java +++ b/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/JaxRsTimeouts.java @@ -7,14 +7,14 @@ import java.time.Duration; */ public interface JaxRsTimeouts { /** - * The connect timeout, which must be at least 1ms. + * The connect timeout, which must be at least 1ms. Called once per real REST call. * * Throws com.google.common.util.concurrent.UncheckedTimeoutException on timeout. */ Duration getConnectTimeoutOrThrow(); /** - * The read timeout, which must be at least 1ms. + * The read timeout, which must be at least 1ms. Called once per real REST call. * * Throws com.google.common.util.concurrent.UncheckedTimeoutException on timeout. */ diff --git a/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java b/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java index 4c97147d61e..a431c41c5cf 100644 --- a/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java +++ b/jaxrs_client_utils/src/main/java/com/yahoo/vespa/jaxrs/client/RetryingJaxRsStrategy.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.jaxrs.client; import com.yahoo.vespa.applicationmodel.HostName; import javax.ws.rs.ProcessingException; +import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.UriBuilder; import java.io.IOException; import java.net.URI; @@ -85,6 +86,7 @@ public class RetryingJaxRsStrategy<T> implements JaxRsStrategy<T> { try { return function.apply(jaxRsClient); } catch (ProcessingException e) { + // E.g. java.net.SocketTimeoutException thrown on read timeout is wrapped as a ProcessingException sampleException = e; logger.log(Level.INFO, "Failed REST API call to " + hostName + ":" + port + pathPrefix + " (in retry loop): " |