Skip to content

Enforce Java 11 response body timeouts#3462

Open
goutamadwant wants to merge 1 commit into
OpenFeign:masterfrom
goutamadwant:fix-http2-response-timeout
Open

Enforce Java 11 response body timeouts#3462
goutamadwant wants to merge 1 commit into
OpenFeign:masterfrom
goutamadwant:fix-http2-response-timeout

Conversation

@goutamadwant

Copy link
Copy Markdown

Summary

This updates the Java 11 Http2Client response handling so the configured Feign read timeout also applies while the response body is being read.

The existing request timeout still covers waiting for the response headers, but BodyHandlers.ofInputStream() can hand back a response before the body has arrived. The response body stream is now wrapped with a read-timeout guard, preserving the existing streaming response behavior while failing stalled body reads with HttpTimeoutException.

Tests

  • mvn --batch-mode -Dtoolchain.skip=true -pl java11 -am -Dtest=Http2ClientTest#timeoutReadingResponseBody,Http2ClientAsyncTest#timeoutReadingResponseBody -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn --batch-mode -Dtoolchain.skip=true -pl java11 -am -Dtest=Http2ClientTest,Http2ClientAsyncTest -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn --batch-mode -Dtoolchain.skip=true -pl java11 -am -Dsurefire.failIfNoSpecifiedTests=false test
  • mvn --batch-mode -Dtoolchain.skip=true -pl java11 -am -DskipTests validate
  • mvn --batch-mode -Dtoolchain.skip=true -pl java11 -am git-code-format:validate-code-format

Fixes #3068

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Http2Client with native HttpClient does not enforce response timeout correctly

1 participant