Skip to content

Conversation

@diegomarquezp
Copy link
Contributor

@diegomarquezp diegomarquezp commented Dec 1, 2025

This PR addresses an issue where setConnectionRequestTimeout was not being honored by Apache5HttpTransport.
The root cause was that Apache5HttpRequest created a new RequestConfig for each request, overwriting the default configuration set on the HttpClient.
Changes:

  • Include setConnectionRequestTimeout as a setting affected by setTimeout(int, int) so that it uses the connectTimeout argument.
  • Add unit test to confirm behavior.

@product-auto-label product-auto-label bot added the size: xl Pull request size is extra large. label Dec 1, 2025
@diegomarquezp diegomarquezp changed the title Apache5 connection request config feat: Add constructor with connection request config for Apache 5 http client Dec 1, 2025
@diegomarquezp diegomarquezp force-pushed the apache5-connection-request-config branch from a53bce4 to 9de5064 Compare December 1, 2025 17:24
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: xl Pull request size is extra large. labels Dec 1, 2025
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Dec 1, 2025
@diegomarquezp diegomarquezp changed the title feat: Add constructor with connection request config for Apache 5 http client fix(apache5): set connection request timeout on setTimeout Dec 1, 2025
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: l Pull request size is large. labels Dec 1, 2025
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Dec 1, 2025
@diegomarquezp diegomarquezp marked this pull request as ready for review December 1, 2025 22:21
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Dec 17, 2025
public void setTimeout(int connectTimeout, int readTimeout) throws IOException {
requestConfig
.setConnectTimeout(Timeout.of(connectTimeout, TimeUnit.MILLISECONDS))
.setConnectionRequestTimeout(connectTimeout, TimeUnit.MILLISECONDS)

Choose a reason for hiding this comment

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

Do you mind adding javadocs for it? Looks like setConnectionRequestTimeout is a Apache client thing and does not exist in other implementations such as NetHttpRequest. So we may want to add docs only to this method not the interface.

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

Labels

size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants