-
Notifications
You must be signed in to change notification settings - Fork 744
SOLR-17776: Harmonize SolrJ timeouts #3357
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
Changes from all commits
de70e42
20c0930
1f212bf
8acb83f
73678f3
7cb8251
2e0e471
d993476
253ee43
beb432a
454a667
cd47a62
1bafa63
80c2a20
b8b8cce
f823d03
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 |
---|---|---|
|
@@ -360,7 +360,6 @@ private void requestRecovery( | |
try (SolrClient client = | ||
new Http2SolrClient.Builder(baseUrl) | ||
.withHttpClient(solrClient) | ||
.withConnectionTimeout(30000, TimeUnit.MILLISECONDS) | ||
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. Not supported anymore if we use an existing HttpClient. No big deal. |
||
.withIdleTimeout(120000, TimeUnit.MILLISECONDS) | ||
.build()) { | ||
client.request(recoverRequestCmd); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,8 +179,6 @@ public class IndexFetcher { | |
|
||
private final Http2SolrClient solrClient; | ||
|
||
private Integer connTimeout; | ||
|
||
private Integer soTimeout; | ||
|
||
private boolean skipCommitOnLeaderVersionZero = true; | ||
|
@@ -258,7 +256,6 @@ private Http2SolrClient createSolrClient( | |
.withHttpClient(updateShardHandler.getRecoveryOnlyHttpClient()) | ||
.withBasicAuthCredentials(httpBasicAuthUser, httpBasicAuthPassword) | ||
.withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS) | ||
.withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS) | ||
.build(); | ||
} | ||
|
||
|
@@ -287,7 +284,6 @@ public IndexFetcher( | |
String compress = (String) initArgs.get(COMPRESSION); | ||
useInternalCompression = ReplicationHandler.INTERNAL.equals(compress); | ||
useExternalCompression = ReplicationHandler.EXTERNAL.equals(compress); | ||
connTimeout = getParameter(initArgs, HttpClientUtil.PROP_CONNECTION_TIMEOUT, 30000, null); | ||
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. Not supported anymore if we use an existing HttpClient. No big deal. Here this setting comes from ReplicationHandler config in solrconfig.xml but I don't think anyone specifies this (I searched for it and didn't see in all of Solr configs/tests). |
||
soTimeout = getParameter(initArgs, HttpClientUtil.PROP_SO_TIMEOUT, 120000, null); | ||
|
||
String httpBasicAuthUser = (String) initArgs.get(HttpClientUtil.PROP_BASIC_AUTH_USER); | ||
|
dsmiley marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,19 +205,14 @@ private static Http2SolrClient.Builder newHttp2SolrClientBuilder( | |
.withDefaultCollection(URLUtil.extractCoreFromCoreUrl(url)); | ||
if (http2SolrClient != null) { | ||
builder.withHttpClient(http2SolrClient); | ||
// cannot set connection timeout | ||
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. Okay? I suppose. 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. Should we validate that the 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. I dug into this... the timeouts came from https://issues.apache.org/jira/browse/SOLR-14672 which is more about making them inheritable instead of hard-coded. We have that already -- they are inherited from the passed in client, which in turn has values that are configurable via HttpSolrClientProvider via UpdateShardHandlerConfig via solr.xml. |
||
} else { | ||
builder.withConnectionTimeout(minConnTimeout, TimeUnit.MILLISECONDS); | ||
} | ||
builder.withIdleTimeout( | ||
Math.max(minSocketTimeout, builder.getIdleTimeoutMillis()), TimeUnit.MILLISECONDS); | ||
builder.withOptionalBasicAuthCredentials(basicAuthCredentials); | ||
|
||
long idleTimeout = minSocketTimeout; | ||
if (builder.getIdleTimeoutMillis() != null) { | ||
idleTimeout = Math.max(idleTimeout, builder.getIdleTimeoutMillis()); | ||
} | ||
builder.withIdleTimeout(idleTimeout, TimeUnit.MILLISECONDS); | ||
long connTimeout = minConnTimeout; | ||
if (builder.getConnectionTimeout() != null) { | ||
connTimeout = Math.max(idleTimeout, builder.getConnectionTimeout()); | ||
} | ||
builder.withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS); | ||
return builder; | ||
} | ||
|
||
|
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.
Not supported anymore if we use an existing HttpClient. No big deal.