RC1 Hystrix Timeout Issue
See original GitHub issueHi,
Is anyone else experiencing any issues with RC1 in regards to Feign / Ribbon clients using a Hystrix timeout? Previously using M4 (as M5 had a couple of showstopper bugs which meant we couldn’t upgrade) and switching to RC1 via:
From:
springCloudStarterParentVersion = 'Brixton.M4'
springCloudNetflixVersion = '1.1.0.M4'
springCloudStarterVersion = '1.1.0.M4'
To:
springCloudStarterParentVersion = 'Brixton.RC1'
springCloudNetflixVersion = '1.1.0.RC1'
springCloudStarterVersion = '1.1.0.RC1'
dependencyManagement {
imports {
// Spring Cloud BOM
mavenBom "org.springframework.cloud:spring-cloud-starter-parent:${springCloudStarterParentVersion}"
// Spring Cloud Netflix BOM
mavenBom "org.springframework.cloud:spring-cloud-netflix:${springCloudNetflixVersion}"
// Spring Boot BOM
mavenBom "org.springframework.boot:spring-boot-starter-parent:${springBootVersion}"
}
My Feign / Ribbon Client uses a hard-coded server list (rather than Eureka) as the service I’m connecting to doesn’t register with Eureka. This is done via the following configuration class which just reads the list of servers from the application.yml file.
@Configuration
public class XxxServiceClientConfig {
private String name = "xxx-engine";
@Bean
public IClientConfig ribbonClientConfig() {
DefaultClientConfigImpl config = new DefaultClientConfigImpl();
config.loadProperties(this.name);
return config;
}
@Bean
ServerList<Server> ribbonServerList(IClientConfig config) {
ConfigurationBasedServerList serverList = new ConfigurationBasedServerList();
serverList.initWithNiwsConfig(config);
return serverList;
}
}
The Feign client is fairly basic:
@FeignClient(name = "xxx-engine")
public interface XxxServiceClient {
@RequestMapping(method = RequestMethod.POST,
value = "/api/v1/xxx",
produces = "application/json",
consumes = "application/json")
XxxOutputDTO getXxx(XxxInputDTO xxxInputDTO);
}
And the Feign / Ribbon client is registered in the app via:
@SpringBootApplication
@EnableJpaRepositories
@EntityScan
@EnableCircuitBreaker
@EnableDiscoveryClient
@EnableFeignClients
@RibbonClients({
@RibbonClient(name = "xxx-engine", configuration = XxxServiceClientConfig.class)
})
public class XxxApplication {
...
}
Under Brixton.M4 (and Netflix M4) this runs without a hitch however switching across to RC1 (for both) just sits there until the Hystrix timeout gets triggered.
Any hints (or upgrade guide style info) on what changed between M4 and RC1 that would effect Feign / Ribbon / Hystrix would be much appreciated.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
Top GitHub Comments
Finally got a chance to spend some time on this… happy to report that it doesn’t appear to be a bug per se, rather a change in behaviour which makes sense yet isn’t obvious based on the behaviour exhibited.
My (cut down) Hystrix and Feign / Ribbon configuration looks like this:
If you call ‘xxx-engine’ and the request takes longer than 10 seconds to return:
_Solution_: Increasing the ReadTimeout to an appropriate value resolves the issue.
_Suggestion_: If at all possible, Hystrix should timeout / throw back the exception as soon as Feign times out rather than, knowing that the call timed out, keep going until it itself hits it’s own timeout.
Closing this due to inactivity. Please re-open if there’s more to discuss.