question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RC1 Hystrix Timeout Issue

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chrisdadejcommented, Apr 20, 2016

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:

hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000

xxx-engine:
  ribbon:
    MaxAutoRetries: 2
    ConnectTimeout: 5000
    ReadTimeout: 10000
    OkToRetryOnAllOperations: true
    EnableGZIPContentEncodingFilter: true

If you call ‘xxx-engine’ and the request takes longer than 10 seconds to return:

  • in M4, everything worked as normal and you had up until the Hystrix thread timeout to wait for the response. i.e. it is as if the read timeout was ignored or at least handled differently.
  • in RC1 (and RC2), it would timeout after 10 seconds… but you wouldn’t know about it until the Hystrix thread timed out. e.g. if the response took 12 seconds, the call would sit there for 60 seconds even though the Feign call timed out after 10 seconds!

_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.

0reactions
spencergibbcommented, Oct 5, 2016

Closing this due to inactivity. Please re-open if there’s more to discuss.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Index (Hystrix Javadoc 1.5.3-rc.1)
If HystrixCommandProperties.executionIsolationThreadInterruptOnTimeout == true and the command is thread-isolated, the executing thread will be interrupted.
Read more >
Hystrix command fails with "timed-out and no fallback available"
This is a Hystrix Command Timeout, this timeout is enabled by default per each command, you define the value using the property:.
Read more >
Spring Cloud Netflix
Hystrix Timeouts And Ribbon Clients ... RC1. This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration and binding to ...
Read more >
Resilience: Hystrix - Microservice Architecture - Educative.io
Without a timeout, a thread can block for a very long time because the thread does not get a response from another microservice....
Read more >
Setting OpenFeign Hystrix Timeout | by Mladen Bolic - Medium
The solution for this issue was fairly simple: setup the higher timeout for Hystrix requests, 2000ms seemed quite reasonable. So how do we ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found