Skip to content

Honor zero connect and read timeouts in the Java11 client - #3637

Merged
velo merged 2 commits into
OpenFeign:masterfrom
hutiefang76:frank/thirty-feign-zero-timeout-20261020
Nov 9, 2026
Merged

velo merged 2 commits into
OpenFeign:masterfrom
hutiefang76:frank/thirty-feign-zero-timeout-20261020

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

Closes #3635.

Honor the documented 0 = no timeout contract by omitting the JDK connect/request timeout setters for zero. An absent native connect timeout now matches zero options. Positive timeouts and rejection of negative values are preserved; streaming response-body timeouts (#3068) are outside this change.

The real HTTP baseline had 7 zero-timeout errors and 2 passing positive controls across synchronous/asynchronous execution. All 11 regression cases now pass, including negative-value controls.

Validation: root ./mvnw -Pdev validate and ./mvnw -Pdev -pl java11 -am clean verify passed with real Zulu 8/11 main compilation and Temurin 25 tests (891 tests, 0 failures/errors, 4 existing conditional skips). License and formatting checks stayed enabled.

Omit JDK timeout setters for the documented unbounded value and match a native
client with no connect timeout. Preserve positive limits and negative rejection.

Fixes OpenFeign#3635

@velo velo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked that both JDK setters reject Duration.ZERO, so before this change a 0 timeout threw instead of meaning no timeout. Skipping the setter is the right fix, and treating an absent native connect timeout as 0 in doesClientConfigurationDiffer avoids building a needless per-request client. The tests cover sync and async, each zero combination, a positive control and negative-value rejection, and they would fail on master. Nit: #3462 adds a body-read timeout that also treats <= 0 as no timeout, so the two agree.

@velo
velo enabled auto-merge (squash) November 9, 2026 20:39
@velo

velo commented Nov 9, 2026

Copy link
Copy Markdown
Member

@hutiefang76 this is approved and set to auto-merge, but it now conflicts with master in CHANGELOG.md, because other PRs have added entries under ### Version 13.18. Please merge or rebase master and put your bullet under the existing 13.18 heading. It'll merge once CI is green.

Signed-off-by: Marvin Froeder <velo.br@gmail.com>

# Conflicts:
#	CHANGELOG.md
@velo

velo commented Nov 9, 2026

Copy link
Copy Markdown
Member

Merged master; CHANGELOG.md was removed from the repo so the entry was dropped.

@velo
velo merged commit 75566d0 into OpenFeign:master Nov 9, 2026
3 checks passed
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.

Java11 Http2Client rejects documented zero connect and read timeouts

2 participants