openjdk:10.0.1-jre-slim
I have a ribbon client called serviceA
and associated
serviceA.ribbon.ConnectTimeout=5000
serviceA.ribbon.ReadTimeout=15000
hystrix.command.serviceA.execution.isolation.thread.timeoutInMilliseconds = 20000
I have not (knowingly) got spring-retry on the classpath. I execute ./mvnw dependency:list | grep -i retry
and get no results.
At runtime I get these warnings:
The Hystrix timeout of 20000ms for the command serviceA is set lower than the combination of the Ribbon read and connect timeout, 40000ms.
I'm not sure where these numbers come from given that I thought I'd set them to 15 and 5 seconds respectively. Why is this figure double?
Actually, ribbon timeout includes all same server retry and next server retry.
ribbonTimeout = (ribbon.ConnectTimeout + ribbon.ReadTimeout) * (ribbon.MaxAutoRetries + 1) * (ribbon.MaxAutoRetriesNextServer + 1);
// ...
if(hystrixTimeout < ribbonTimeout) {
LOGGER.warn("The Hystrix timeout of " + hystrixTimeout + "ms for the command " + commandKey +
" is set lower than the combination of the Ribbon read and connect timeout, " + ribbonTimeout + "ms.");
}
In your configuration:
So the hystrixTimeout should be:
(5000 + 15000) * (1 + 0) * (1 + 1) // -> 40000 ms
If you choose to not configure Hystrix timeout, the default Hystrix timeout will be 40000ms.