ok2c commented on a change in pull request #356:
URL:
https://github.com/apache/httpcomponents-client/pull/356#discussion_r838353439
##########
File path:
httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/HttpRequestRetryExec.java
##########
@@ -113,6 +113,24 @@ public ClassicHttpResponse execute(
LOG.info("Recoverable I/O exception ({}) caught when
processing request to {}",
ex.getClass().getName(), route);
}
+ final TimeValue nextInterval =
retryStrategy.getRetryInterval(request, ex, execCount, context);
+ // Make sure the retry interval does not exceed the
response timeout
+ if (TimeValue.isPositive(nextInterval)) {
+ final RequestConfig requestConfig =
context.getRequestConfig();
+ final Timeout responseTimeout =
requestConfig.getResponseTimeout();
+ if (responseTimeout != null &&
nextInterval.compareTo(responseTimeout) > 0) {
Review comment:
@ajbaldocchi the response timeout is not applicable here. Please drop
this check.
##########
File path:
httpclient5/src/main/java/org/apache/hc/client5/http/HttpRequestRetryStrategy.java
##########
@@ -75,6 +75,22 @@
*/
boolean retryRequest(HttpResponse response, int execCount, HttpContext
context);
+
+ /**
+ * Determines the retry interval between subsequent retries.
+ *
+ * @param request the request failed due to an I/O exception
+ * @param exception the exception that occurred
+ * @param execCount the number of times this method has been
+ * unsuccessfully executed
+ * @param context the context for the request execution
+ *
+ * @return the retry interval between subsequent retries
+ */
+ default TimeValue getRetryInterval(HttpRequest request, IOException
exception, int execCount, HttpContext context) {
Review comment:
@ajbaldocchi Please the existing `getRetryInterval` method for default
implementation of this method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]