Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRESOLVER-612] Align timeout interpretations across HTTP transports #587

Merged
merged 5 commits into from
Oct 24, 2024

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Oct 23, 2024

The ConfigurationProperties#REQUEST_TIMEOUT was wrongly interpreted by JDK and Jetty clients as "absolute max duration of HTTP request".

Also, up default CONNECT_TIMEOUT from 10sec to 30sec.

Changes per transport:

  • apache: explain meaning in comments and fix one mixed up timeout
  • JDK: remove use of request timeout (as it means "abs max time for request"), note that REQUEST_TIMEOUT is not supported, ignore UT
  • Jetty: remove use of request timeout (as it means "abs max time for request"), use "idle timeout" that means "max time of silence between any traffic/sending or receiving packets".

https://issues.apache.org/jira/browse/MRESOLVER-612
https://issues.apache.org/jira/browse/MRESOLVER-615

The `ConfigurationProperties#REQUEST_TIMEOUT` was wrongly interpreted
by JDK and Jetty clients as "absolute max duration of HTTP request".

Also, up default CONNECT_TIMEOUT from 10sec to 30sec.
@cstamas cstamas requested review from gnodet and michael-o October 23, 2024 13:27
@cstamas cstamas self-assigned this Oct 23, 2024
@cstamas cstamas marked this pull request as ready for review October 23, 2024 13:33
@@ -288,16 +288,20 @@ final class ApacheTransporter extends AbstractTransporter implements HttpTranspo
.register(AuthSchemes.KERBEROS, new KerberosSchemeFactory())
.build();
SocketConfig socketConfig =
SocketConfig.custom().setSoTimeout(requestTimeout).build();
// the time to establish connection (low level)
SocketConfig.custom().setSoTimeout(connectTimeout).build();
Copy link
Contributor

Choose a reason for hiding this comment

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

SO timeout is the read timeout on the socket, so the maximum amount of time between two packets (or, on the server side, the max time for accept()). So I don't think it should be set to connectTimeout.

How does this timeout work wrt to the socket timeout below ? Is the timeout on the SocketConfig used when no value is set on RequestConfig ?

Copy link
Member Author

Choose a reason for hiding this comment

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

SoTimeout is set on socket directly (so it works as Javadoc and you explain). The "socket timeout" is specific to HttpClient and would like to get some clarification about it @michael-o

@cstamas cstamas added this to the 2.0.3 milestone Oct 23, 2024
@cstamas cstamas merged commit 0746435 into apache:master Oct 24, 2024
5 checks passed
@cstamas cstamas deleted the MRESOLVER-612-bis branch October 24, 2024 14:53
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.

2 participants