[jira] [Commented] (SOLR-17300) Copy existing listeners on re-creation of Http2SolrClient

2024-05-23 Thread David Smiley (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848939#comment-17848939
 ] 

David Smiley commented on SOLR-17300:
-

"Interrupted while obtaining reference to CoreService" – I am working on fixing 
this old very intermittent bug SOLR-17118

> Copy existing listeners on re-creation of Http2SolrClient
> -
>
> Key: SOLR-17300
> URL: https://issues.apache.org/jira/browse/SOLR-17300
> Project: Solr
>  Issue Type: Sub-task
>Reporter: Sanjay Dutt
>Assignee: Sanjay Dutt
>Priority: Major
> Fix For: 9.7
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For custom settings, such as timeouts, usually a Http2SolrClient is created 
> using the existing HTTP client using below code.
> {code:java}
> Http2SolrClient.Builder(leaderBaseUrl)
> .withHttpClient(existingHttp2SolrClient)
> .withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS)
> .withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS)
> .build();
> {code}
> If not specified, withHttpClient method would automatically copy over some of 
> the older configuration automatically to the new Http2SolrClient
> {code:java}
> if (this.basicAuthAuthorizationStr == null) {
> this.basicAuthAuthorizationStr = 
> http2SolrClient.basicAuthAuthorizationStr;
>   }
>   if (this.followRedirects == null) {
> this.followRedirects = http2SolrClient.httpClient.isFollowRedirects();
>   }
>   if (this.idleTimeoutMillis == null) {
> this.idleTimeoutMillis = http2SolrClient.idleTimeoutMillis;
>   }
>   if (this.requestWriter == null) {
> this.requestWriter = http2SolrClient.requestWriter;
>   }
>   if (this.requestTimeoutMillis == null) {
> this.requestTimeoutMillis = http2SolrClient.requestTimeoutMillis;
>   }
>   if (this.responseParser == null) {
> this.responseParser = http2SolrClient.parser;
>   }
>   if (this.urlParamNames == null) {
> this.urlParamNames = http2SolrClient.urlParamNames;
>   }
> {code}
> Nonetheless there is one field that did not pass over yet -- List of 
> HttpListenerFactory. This list also includes the interceptor for Auth due to 
> which re-created client were missing auth credentials and requests were 
> failing.
> *Proposed Solution* :- 
> Along with other properties, List of Listener Factory should also be copied 
> over from old to new client using withHttpClient method.
> {code:java}
> if (this.listenerFactory == null) {
> this.listenerFactory = new ArrayList();
> http2SolrClient.listenerFactory.forEach(this.listenerFactory::add);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Commented] (SOLR-17300) Copy existing listeners on re-creation of Http2SolrClient

2024-05-23 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848868#comment-17848868
 ] 

ASF subversion and git services commented on SOLR-17300:


Commit 19a4b6e0af964525d616f2f54d954213b3f55226 in solr's branch 
refs/heads/branch_9x from Sanjay Dutt
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=19a4b6e0af9 ]

SOLR-17300: Ensure listeners are copied when re-creating Http2SolrClient using 
withHttpClient
* Http2SolrClient.Builder.withHttpClient now copies HttpListenerFactory (e.g. 
for auth, metrics, traces, etc.)
* Mark Http2SolrClient#addListenerFactory as deprecated to avoid adding 
listeners after the client is created. Instead, use 
Http2SolrClient.Builder#withListenerFactory during the client's creation to add 
all listeners.


> Copy existing listeners on re-creation of Http2SolrClient
> -
>
> Key: SOLR-17300
> URL: https://issues.apache.org/jira/browse/SOLR-17300
> Project: Solr
>  Issue Type: Sub-task
>Reporter: Sanjay Dutt
>Assignee: Sanjay Dutt
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For custom settings, such as timeouts, usually a Http2SolrClient is created 
> using the existing HTTP client using below code.
> {code:java}
> Http2SolrClient.Builder(leaderBaseUrl)
> .withHttpClient(existingHttp2SolrClient)
> .withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS)
> .withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS)
> .build();
> {code}
> If not specified, withHttpClient method would automatically copy over some of 
> the older configuration automatically to the new Http2SolrClient
> {code:java}
> if (this.basicAuthAuthorizationStr == null) {
> this.basicAuthAuthorizationStr = 
> http2SolrClient.basicAuthAuthorizationStr;
>   }
>   if (this.followRedirects == null) {
> this.followRedirects = http2SolrClient.httpClient.isFollowRedirects();
>   }
>   if (this.idleTimeoutMillis == null) {
> this.idleTimeoutMillis = http2SolrClient.idleTimeoutMillis;
>   }
>   if (this.requestWriter == null) {
> this.requestWriter = http2SolrClient.requestWriter;
>   }
>   if (this.requestTimeoutMillis == null) {
> this.requestTimeoutMillis = http2SolrClient.requestTimeoutMillis;
>   }
>   if (this.responseParser == null) {
> this.responseParser = http2SolrClient.parser;
>   }
>   if (this.urlParamNames == null) {
> this.urlParamNames = http2SolrClient.urlParamNames;
>   }
> {code}
> Nonetheless there is one field that did not pass over yet -- List of 
> HttpListenerFactory. This list also includes the interceptor for Auth due to 
> which re-created client were missing auth credentials and requests were 
> failing.
> *Proposed Solution* :- 
> Along with other properties, List of Listener Factory should also be copied 
> over from old to new client using withHttpClient method.
> {code:java}
> if (this.listenerFactory == null) {
> this.listenerFactory = new ArrayList();
> http2SolrClient.listenerFactory.forEach(this.listenerFactory::add);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Commented] (SOLR-17300) Copy existing listeners on re-creation of Http2SolrClient

2024-05-23 Thread Sanjay Dutt (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848866#comment-17848866
 ] 

Sanjay Dutt commented on SOLR-17300:


Test failed during testing this change for branch_9x. 
{code:java}
gradlew :solr:solrj:test --tests 
"org.apache.solr.client.solrj.impl.LBHttpSolrClientBadInputTest" 
-Ptests.jvms=96 "-Ptests.jvmargs=-XX:TieredStopAtLevel=1 -XX:+UseParallelGC 
-XX:ActiveProcessorCount=1 -XX:ReservedCodeCacheSize=120m" 
-Ptests.seed=F3C1EFAC7BB52FA5 -Ptests.timeoutSuite=60! 
-Ptests.file.encoding=US-ASCII{code}
 
{code:java}
org.apache.solr.client.solrj.impl.LBHttpSolrClientBadInputTest > classMethod 
FAILED
    java.lang.Exception: Suite timeout exceeded (>= 60 msec).
        at __randomizedtesting.SeedInfo.seed([F3C1EFAC7BB52FA5]:0)
{code}
 

Checked its [history. 
|https://ge.apache.org/scans/tests?search.relativeStartTime=P90D=solr-root=America%2FNew_York=org.apache.solr.client.solrj.impl.LBHttpSolrClientBadInputTest]Never
 really failed before, (I hope I am checking at the right place)
{code:java}
org.apache.solr.common.SolrException: Interrupted while obtaining reference to 
CoreService
  2> at 
org.apache.solr.servlet.CoreContainerProvider$ServiceHolder.getService(CoreContainerProvider.java:571)
  2> org.apache.solr.common.SolrException: Interrupted while obtaining 
reference to CoreService
  2> at 
org.apache.solr.servlet.CoreContainerProvider$ServiceHolder.getService(CoreContainerProvider.java:571)
 ~[solr-core-9.7.0-SNAPSHOT.jar:9.7.0-SNAPSHOT 
19a4b6e0af964525d616f2f54d954213b3f55226 [snapshot build, details omitted]]
  2> at 
org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:147) 
[solr-core-9.7.0-SNAPSHOT.jar:9.7.0-SNAPSHOT 
19a4b6e0af964525d616f2f54d954213b3f55226 [snapshot build, details omitted]]
  2> at 
org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:133) 
[jetty-servlet-10.0.20.jar:10.0.20]
  2> at 
org.eclipse.jetty.servlet.ServletHandler.initializeHolders(ServletHandler.java:774)
 [jetty-servlet-10.0.20.jar:10.0.20]
  2> at 
org.eclipse.jetty.servlet.ServletHandler.setFilters(ServletHandler.java:1472) 
[jetty-servlet-10.0.20.jar:10.0.20]
  2> at 
org.eclipse.jetty.servlet.ServletHandler.addFilterWithMapping(ServletHandler.java:992)
 [jetty-servlet-10.0.20.jar:10.0.20]
  2> at 
org.eclipse.jetty.servlet.ServletContextHandler.addFilter(ServletContextHandler.java:480)
 [jetty-servlet-10.0.20.jar:10.0.20]
  2> at 
org.apache.solr.embedded.JettySolrRunner$1.lifeCycleStarted(JettySolrRunner.java:429)
 [solr-test-framework-9.7.0-SNAPSHOT.jar:9.7.0-SNAPSHOT 
19a4b6e0af964525d616f2f54d954213b3f55226 [snapshot build, details omitted]]
  2> at 
org.eclipse.jetty.util.component.AbstractLifeCycle.setStarted(AbstractLifeCycle.java:253)
 [jetty-util-10.0.20.jar:10.0.20]
  2> at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:94)
 [jetty-util-10.0.20.jar:10.0.20]
  2> at 
org.apache.solr.embedded.JettySolrRunner.retryOnPortBindFailure(JettySolrRunner.java:618)
 [solr-test-framework-9.7.0-SNAPSHOT.jar:9.7.0-SNAPSHOT 
19a4b6e0af964525d616f2f54d954213b3f55226 [snapshot build, details omitted]]


{code}
Ran it multiple times. Flaky, I believe.

> Copy existing listeners on re-creation of Http2SolrClient
> -
>
> Key: SOLR-17300
> URL: https://issues.apache.org/jira/browse/SOLR-17300
> Project: Solr
>  Issue Type: Sub-task
>Reporter: Sanjay Dutt
>Assignee: Sanjay Dutt
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For custom settings, such as timeouts, usually a Http2SolrClient is created 
> using the existing HTTP client using below code.
> {code:java}
> Http2SolrClient.Builder(leaderBaseUrl)
> .withHttpClient(existingHttp2SolrClient)
> .withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS)
> .withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS)
> .build();
> {code}
> If not specified, withHttpClient method would automatically copy over some of 
> the older configuration automatically to the new Http2SolrClient
> {code:java}
> if (this.basicAuthAuthorizationStr == null) {
> this.basicAuthAuthorizationStr = 
> http2SolrClient.basicAuthAuthorizationStr;
>   }
>   if (this.followRedirects == null) {
> this.followRedirects = http2SolrClient.httpClient.isFollowRedirects();
>   }
>   if (this.idleTimeoutMillis == null) {
> this.idleTimeoutMillis = http2SolrClient.idleTimeoutMillis;
>   }
>   if (this.requestWriter == null) {
> this.requestWriter = http2SolrClient.requestWriter;
>   }
>   if (this.requestTimeoutMillis == null) {
> this.requestTimeoutMillis = http2SolrClient.requestTimeoutMillis;
>   }
>   if 

[jira] [Commented] (SOLR-17300) Copy existing listeners on re-creation of Http2SolrClient

2024-05-21 Thread Sanjay Dutt (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848270#comment-17848270
 ] 

Sanjay Dutt commented on SOLR-17300:


To back-port this commit, I need to use below command?
{code:java}
dev-tools/scripts/cherrypick.sh -b branch_9 
3837eebcd73e103c083d7b02bdf6904d08fc34b5{code}

> Copy existing listeners on re-creation of Http2SolrClient
> -
>
> Key: SOLR-17300
> URL: https://issues.apache.org/jira/browse/SOLR-17300
> Project: Solr
>  Issue Type: Sub-task
>Reporter: Sanjay Dutt
>Assignee: Sanjay Dutt
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For custom settings, such as timeouts, usually a Http2SolrClient is created 
> using the existing HTTP client using below code.
> {code:java}
> Http2SolrClient.Builder(leaderBaseUrl)
> .withHttpClient(existingHttp2SolrClient)
> .withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS)
> .withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS)
> .build();
> {code}
> If not specified, withHttpClient method would automatically copy over some of 
> the older configuration automatically to the new Http2SolrClient
> {code:java}
> if (this.basicAuthAuthorizationStr == null) {
> this.basicAuthAuthorizationStr = 
> http2SolrClient.basicAuthAuthorizationStr;
>   }
>   if (this.followRedirects == null) {
> this.followRedirects = http2SolrClient.httpClient.isFollowRedirects();
>   }
>   if (this.idleTimeoutMillis == null) {
> this.idleTimeoutMillis = http2SolrClient.idleTimeoutMillis;
>   }
>   if (this.requestWriter == null) {
> this.requestWriter = http2SolrClient.requestWriter;
>   }
>   if (this.requestTimeoutMillis == null) {
> this.requestTimeoutMillis = http2SolrClient.requestTimeoutMillis;
>   }
>   if (this.responseParser == null) {
> this.responseParser = http2SolrClient.parser;
>   }
>   if (this.urlParamNames == null) {
> this.urlParamNames = http2SolrClient.urlParamNames;
>   }
> {code}
> Nonetheless there is one field that did not pass over yet -- List of 
> HttpListenerFactory. This list also includes the interceptor for Auth due to 
> which re-created client were missing auth credentials and requests were 
> failing.
> *Proposed Solution* :- 
> Along with other properties, List of Listener Factory should also be copied 
> over from old to new client using withHttpClient method.
> {code:java}
> if (this.listenerFactory == null) {
> this.listenerFactory = new ArrayList();
> http2SolrClient.listenerFactory.forEach(this.listenerFactory::add);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Commented] (SOLR-17300) Copy existing listeners on re-creation of Http2SolrClient

2024-05-21 Thread David Smiley (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848258#comment-17848258
 ] 

David Smiley commented on SOLR-17300:
-

Nicely done.  The next step is to back-port to branch_9x.  There's a 
{{dev-tools/cherrypick.sh}} script to make this easier.  Once that is done, you 
can "Resolve" (but not "Close") this JIRA issue and choose the next minor 
release as the fix-version -- 9.7.0.

> Copy existing listeners on re-creation of Http2SolrClient
> -
>
> Key: SOLR-17300
> URL: https://issues.apache.org/jira/browse/SOLR-17300
> Project: Solr
>  Issue Type: Sub-task
>Reporter: Sanjay Dutt
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For custom settings, such as timeouts, usually a Http2SolrClient is created 
> using the existing HTTP client using below code.
> {code:java}
> Http2SolrClient.Builder(leaderBaseUrl)
> .withHttpClient(existingHttp2SolrClient)
> .withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS)
> .withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS)
> .build();
> {code}
> If not specified, withHttpClient method would automatically copy over some of 
> the older configuration automatically to the new Http2SolrClient
> {code:java}
> if (this.basicAuthAuthorizationStr == null) {
> this.basicAuthAuthorizationStr = 
> http2SolrClient.basicAuthAuthorizationStr;
>   }
>   if (this.followRedirects == null) {
> this.followRedirects = http2SolrClient.httpClient.isFollowRedirects();
>   }
>   if (this.idleTimeoutMillis == null) {
> this.idleTimeoutMillis = http2SolrClient.idleTimeoutMillis;
>   }
>   if (this.requestWriter == null) {
> this.requestWriter = http2SolrClient.requestWriter;
>   }
>   if (this.requestTimeoutMillis == null) {
> this.requestTimeoutMillis = http2SolrClient.requestTimeoutMillis;
>   }
>   if (this.responseParser == null) {
> this.responseParser = http2SolrClient.parser;
>   }
>   if (this.urlParamNames == null) {
> this.urlParamNames = http2SolrClient.urlParamNames;
>   }
> {code}
> Nonetheless there is one field that did not pass over yet -- List of 
> HttpListenerFactory. This list also includes the interceptor for Auth due to 
> which re-created client were missing auth credentials and requests were 
> failing.
> *Proposed Solution* :- 
> Along with other properties, List of Listener Factory should also be copied 
> over from old to new client using withHttpClient method.
> {code:java}
> if (this.listenerFactory == null) {
> this.listenerFactory = new ArrayList();
> http2SolrClient.listenerFactory.forEach(this.listenerFactory::add);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org



[jira] [Commented] (SOLR-17300) Copy existing listeners on re-creation of Http2SolrClient

2024-05-21 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/SOLR-17300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17848252#comment-17848252
 ] 

ASF subversion and git services commented on SOLR-17300:


Commit 3837eebcd73e103c083d7b02bdf6904d08fc34b5 in solr's branch 
refs/heads/main from Sanjay Dutt
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=3837eebcd73 ]

SOLR-17300: Ensure listeners are copied when re-creating Http2SolrClient using 
withHttpClient (#2467)

* Http2SolrClient.Builder.withHttpClient now copies HttpListenerFactory (e.g. 
for auth, metrics, traces, etc.)

* Mark Http2SolrClient#addListenerFactory as deprecated to avoid adding 
listeners after the client is created. Instead, use 
Http2SolrClient.Builder#withListenerFactory during the client's creation to add 
all listeners.
-

Co-authored-by: iamsanjay 

> Copy existing listeners on re-creation of Http2SolrClient
> -
>
> Key: SOLR-17300
> URL: https://issues.apache.org/jira/browse/SOLR-17300
> Project: Solr
>  Issue Type: Sub-task
>Reporter: Sanjay Dutt
>Priority: Major
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> For custom settings, such as timeouts, usually a Http2SolrClient is created 
> using the existing HTTP client using below code.
> {code:java}
> Http2SolrClient.Builder(leaderBaseUrl)
> .withHttpClient(existingHttp2SolrClient)
> .withIdleTimeout(soTimeout, TimeUnit.MILLISECONDS)
> .withConnectionTimeout(connTimeout, TimeUnit.MILLISECONDS)
> .build();
> {code}
> If not specified, withHttpClient method would automatically copy over some of 
> the older configuration automatically to the new Http2SolrClient
> {code:java}
> if (this.basicAuthAuthorizationStr == null) {
> this.basicAuthAuthorizationStr = 
> http2SolrClient.basicAuthAuthorizationStr;
>   }
>   if (this.followRedirects == null) {
> this.followRedirects = http2SolrClient.httpClient.isFollowRedirects();
>   }
>   if (this.idleTimeoutMillis == null) {
> this.idleTimeoutMillis = http2SolrClient.idleTimeoutMillis;
>   }
>   if (this.requestWriter == null) {
> this.requestWriter = http2SolrClient.requestWriter;
>   }
>   if (this.requestTimeoutMillis == null) {
> this.requestTimeoutMillis = http2SolrClient.requestTimeoutMillis;
>   }
>   if (this.responseParser == null) {
> this.responseParser = http2SolrClient.parser;
>   }
>   if (this.urlParamNames == null) {
> this.urlParamNames = http2SolrClient.urlParamNames;
>   }
> {code}
> Nonetheless there is one field that did not pass over yet -- List of 
> HttpListenerFactory. This list also includes the interceptor for Auth due to 
> which re-created client were missing auth credentials and requests were 
> failing.
> *Proposed Solution* :- 
> Along with other properties, List of Listener Factory should also be copied 
> over from old to new client using withHttpClient method.
> {code:java}
> if (this.listenerFactory == null) {
> this.listenerFactory = new ArrayList();
> http2SolrClient.listenerFactory.forEach(this.listenerFactory::add);
>   }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

-
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org