Http2Client with native HttpClient does not enforce response timeout correctly · Issue #3068 · OpenFeign/feign · GitHub
Skip to content

Http2Client with native HttpClient does not enforce response timeout correctly #3068

Open

Description

@zkorhone

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.

Activity

  1. changed the title [-]Http2Client with native HttpClient does not enforce response correctly timeout[/-] [+]Http2Client with native HttpClient does not enforce response timeout correctly[/+] on Oct 17, 2025
  2. zkorhone commented on May 1, 2026

    @zkorhone
    Author

    Moved on to spring http interface clients

  3. added
    bugUnexpected or incorrect behavior
    on May 27, 2026
  4. velo commented on May 27, 2026

    @velo
    Member

    Thanks for the report. This project is community-maintained, and the maintainer won't implement fixes/features directly. If you want this to move forward, please open a pull request with automated tests that cover the change.\n\nFor bug reports, please also include (or confirm) a minimal reproduction, the affected version(s), and the full stack trace/logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions