You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org> on 2026/08/21 12:16:15 UTC
[PR] SOLR-18360: un-deprecate HttpJettySolrClient.addListenerFactory [solr]
serhiy-bzhezytskyy opened a new pull request, #4780:
URL: https://github.com/apache/solr/pull/4780
https://issues.apache.org/jira/browse/SOLR-18360
Un-deprecates `HttpJettySolrClient.addListenerFactory(HttpListenerFactory)` instead of removing it. `PKIAuthenticationPlugin` needs it to attach a listener to clients that are already built and already referenced elsewhere by the time security wiring runs:
```java
// HttpShardHandlerFactory's constructor:
this.defaultClient = new HttpJettySolrClient.Builder()...build();
this.loadbalancer = new LBJettySolrClient.Builder(defaultClient).build(); // captures defaultClient here
// CoreContainer.setupHttpClientForAuthPlugin, called later (and again on security.json hot-reload):
shardHandlerFactory.setSecurityBuilder(pkiAuthenticationSecurityBuilder); // -> defaultClient.addListenerFactory(...)
```
Rebuilding `defaultClient` via the Builder instead would leave `loadbalancer` pointing at the old, listener-less client -- the security listener would silently never fire on the path that actually routes inter-node requests.
Migrated the one call site that was pure construction-time convenience (`HttpShardHandlerFactory`'s own `defaultClient`) to `Builder.addListenerFactory`. No changelog (un-deprecation, not a removal).
50 tests, 0 failures.
AI-assisted (Claude Sonnet 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: remove HttpJettySolrClient.addListenerFactory via a repointable wrapper [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley merged PR #4780:
URL: https://github.com/apache/solr/pull/4780
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: un-deprecate HttpJettySolrClient.addListenerFactory [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #4780:
URL: https://github.com/apache/solr/pull/4780#issuecomment-5405209294
Maybe a mutable ListenerFactory wrapper could be repointed (a hack), instead of exposing a mutable method on an important SolrJ class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: remove HttpJettySolrClient.addListenerFactory via a repointable wrapper [solr]
Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4780:
URL: https://github.com/apache/solr/pull/4780#issuecomment-5410015224
Implemented -- added `MutableListenerFactory`, a repointable `HttpListenerFactory` (single volatile write, no mutable method on the client). Turned out this also fixes two real bugs the old instance method had: it mutated a plain, unsynchronized `List` while requests iterate it concurrently, and every `security.json` reload silently added another duplicate PKI listener since it only ever appended. Updated PR description with the details.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: remove HttpJettySolrClient.addListenerFactory via a repointable wrapper [solr]
Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4780:
URL: https://github.com/apache/solr/pull/4780#issuecomment-5421350802
@epugh does this need a changelog entry, or should I add `no-changelog`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: un-deprecate HttpJettySolrClient.addListenerFactory [solr]
Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4780:
URL: https://github.com/apache/solr/pull/4780#issuecomment-5369694312
@epugh flagging this un-deprecation (not a removal) -- see PR description for why the instance method is still needed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: remove HttpJettySolrClient.addListenerFactory via a repointable wrapper [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on code in PR #4780:
URL: https://github.com/apache/solr/pull/4780#discussion_r3853177951
##########
solr/core/src/java/org/apache/solr/security/HttpClientBuilderPlugin.java:
##########
@@ -26,5 +26,6 @@
*/
public interface HttpClientBuilderPlugin {
- public default void setup(HttpJettySolrClient client) {}
+ /** May be called more than once; each call replaces the previous listener, not adds to it. */
+ public default void setup(MutableListenerFactory listenerFactory) {}
Review Comment:
If someone is writing a HttpClientBuilderPlugin, maybe this setup method should expose the HttpJettySolrClient? On the other hand, if the client instance is really many/variable but they all share a MutableListenerFactory then it'd be the wrong design. Yeah ... just speaking out loud.
CC @gerlowskija @janhoy the change proposed here changes our API for customizing HttpClientBuilder. It's labeled "lucene.experiment" so I suppose we can change at-will but I want to raise attention on this. It will belong in the changelog.
##########
solr/solrj-jetty/src/java/org/apache/solr/client/solrj/jetty/MutableListenerFactory.java:
##########
Review Comment:
nice documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: remove HttpJettySolrClient.addListenerFactory via a repointable wrapper [solr]
Posted by "dsmiley (via GitHub)" <gi...@apache.org>.
dsmiley commented on PR #4780:
URL: https://github.com/apache/solr/pull/4780#issuecomment-5448677280
Changing HttpClientBuilderPlugin.java deserves a changelog.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-18360: remove HttpJettySolrClient.addListenerFactory via a repointable wrapper [solr]
Posted by "serhiy-bzhezytskyy (via GitHub)" <gi...@apache.org>.
serhiy-bzhezytskyy commented on PR #4780:
URL: https://github.com/apache/solr/pull/4780#issuecomment-5448799632
Added -- see `changelog/unreleased/SOLR-18360-remove-addlistenerfactory.yml`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org