OpenFeign / OpenFeign/feign

Feign timeout doesn't work properly, the response time is far more bigger (approx 1 sec) than the configured timeout (20 ms)

Open
#1,914 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

Hello,

I am using AsyncFeign in a project

Resilience4j version: 1.7.1 or 2.0.2
Spring Boot Version: 3.0.0
Java version: 17
spring-cloud-dependencies: 2022.0.0-RC3
OpenFeign: 4.0.0-RC3
io.github.openfeign:feign-hc5:12.1

We have set the Feign Connection timeout to 10ms and Read timeout to 20 ms. The timeout works and we get a

feign.RetryableException: 20 MILLISECONDS executing GET http://localhost:8082/unstable

but the response is not returned until approx 1030 ms afterward (after more than 1 second in total).

You can see an example of the code in this repo, under the module graphql-java-kickstart-example (ProductClient), it's calling an unstable service also included under the module unstable-service.

This is the current configuration

Thank you in advance

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the timeout behavior using the linked graphql-java-kickstart-example, starting with ProductClient and its application.yml configuration, then inspect the linked unstable-service. Compare the configured 10 ms connection and 20 ms read timeouts with the observed exception and total response time. Done means identifying and correcting the source of the extra delay, with the timeout returning within the configured bounds.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.