Http2Client with native HttpClient does not enforce response timeout correctly
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
Research direction
Start at the Http2Client implementation and review how the native HttpClient applies its request timeout, then compare the behavior with JDK-8208693. The change is complete when timeouts also cover receiving the response body without changing the expected threading behavior; add or update a regression test if the surrounding implementation provides one.
Written by the indexing model from the issue text.
Description
There is a flaw in Java's interface design that makes it very easy to introduce bug where application stalls when using native HttpClient. Request timeout given applies only to point when response headers are received. Timeout does not apply to receiving body.
Official jdk issue: https://bugs.openjdk.org/browse/JDK-8208693
Easiest way to address the problem is to use async sending with orTimeout. The far more complex alternative is to create customer body handler / subscriber that is able to handle timeout correctly.
Considering that writing customer body handler is a non-trivial task and that orTimeout does address the problem, I would recommend changing feign implementation to use asyncSend. Java's internal synchronous implementation is a delegate to async call, so change to async would not change threading behaviour.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 2k
- Avg merge
- 12h 8m
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenFeign/feign
-
JDK 21 on x86_64 causes truncated responses with Feign + HttpClient (content compression related)Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Maintainers usually reply within 1 day
-
question
Difficulty 4/5 3-5 days Newbie friendliness 35/100
OpenFeign/feign#3332 · 1 comment ·
Maintainers usually reply within 1 day
-
question
Difficulty 3/5 1-2 days Newbie friendliness 52/100
OpenFeign/feign#3095 · 1 comment ·
Maintainers usually reply within 1 day
-
bug question
Difficulty 5/5 Over a week Newbie friendliness 25/100
OpenFeign/feign#3074 · 2 comments ·
Maintainers usually reply within 1 day
-
Why EncodeException's message is not nullable in 1st constructor but nullable in 2nd constructor?Openquestion
Difficulty 3/5 1-2 days Newbie friendliness 48/100
OpenFeign/feign#2973 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Flight SQL JDBC parses boolean properties case-sensitively, silently disabling TLS for useEncryption=TRUEPossibly taken @Arawoof06 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
apache/arrow-java#1357 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
apache/rocketmq-dashboard#6610 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MetricsHub/metricshub-community#1396 ·
Maintainers usually reply within 1 day
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
dependabot/dependabot-core#16547 ·
Maintainers usually reply within 1 day
-
Citationcount column sorts alphabetically instead of numericallyPossibly taken @kpunia306 claimed this today. Openstatus: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
JabRef/jabref#17459 · 4 comments ·
Maintainers usually reply within 1 day