-
Notifications
You must be signed in to change notification settings - Fork 845
SOLR-17433: Set default http request timeout to infinite #4626
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
base: main
Are you sure you want to change the base?
Changes from all commits
0a475cf
08359ce
bca4e41
739f3e9
206d1df
898166d
52bad08
e5c4d0b
99fe3d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| title: Changed default http request timeout to infinite | ||
| type: changed | ||
| authors: | ||
| - name: Vishnu Priya Chandra Sekar | ||
| links: | ||
| - name: SOLR-17433 | ||
| url: https://issues.apache.org/jira/browse/SOLR-17433 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,11 @@ public HttpSolrClient solrClient(Integer overrideIdleTimeoutMs) { | |
| var builder = | ||
| new HttpJdkSolrClient.Builder().withSSLContext(MockTrustManager.ALL_TRUSTING_SSL_CONTEXT); | ||
| if (overrideIdleTimeoutMs != null) { | ||
| builder.withIdleTimeout(overrideIdleTimeoutMs, TimeUnit.MILLISECONDS); | ||
| builder | ||
| .withIdleTimeout(overrideIdleTimeoutMs, TimeUnit.MILLISECONDS) | ||
| // override the infinite request timeout with idle timeout to ensure idle requests times | ||
| // out. | ||
|
VishnuPriyaChandraSekar marked this conversation as resolved.
|
||
| .withRequestTimeout(overrideIdleTimeoutMs, TimeUnit.MILLISECONDS); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably just be 0, infinite? |
||
| } | ||
| return builder.build(); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -405,6 +405,9 @@ private class TimeoutZombieTestContext implements AutoCloseable { | |
| new HttpJettySolrClient.Builder() | ||
| .withConnectionTimeout(1000, TimeUnit.MILLISECONDS) | ||
| .withIdleTimeout(1, TimeUnit.MILLISECONDS) | ||
| // override the infinite request timeout with idle timeout to ensure idle requests | ||
| // times out. | ||
|
Comment on lines
+408
to
+409
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. something seems suspicious... the idle timeout should work if the request timeout is infinite. They are different things; idle refers to the longest period of not receiving any data at all from the server. The request timeout is an overall timeout for the entire request.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idle timeout is ineffective for this test. The http client (through Jetty) uses HTTP2 protocol to communicate with the server. After establishing connection with the server, it tries to send the request headers to the server as part of creating HTTP streams. However, the fake server fails to ack the headers.
I was wondering how the test worked before. It looks like the test wanted to simulate socket timeout, however it was not happening. The HTTP request was timing out because of request timeout (previously it took idle timeout as default value.) In order to fix the test, either the fake server must ack the header (Gemini says it is possible however I haven't tried first hand) or simulate request timeout instead. Let me know which one choose Thanks to the Jetty logs [3] for helping me to understand this. [1] https://github.com/jetty/jetty.project/blob/jetty-12.1.x/jetty-core/jetty-http2/jetty-http2-client-transport/src/main/java/org/eclipse/jetty/http2/client/transport/internal/HttpSenderOverHTTP2.java#L203 |
||
| .withRequestTimeout(1, TimeUnit.MILLISECONDS) | ||
| .build(); | ||
|
|
||
| lbClient = new LBJettySolrClient.Builder(delegateClient, nonRoutableEndpoint).build(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.