Skip to content

SOLR-17804: re-create SolrClient if closed. #3411

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

Merged
merged 11 commits into from
Jul 9, 2025
Merged

Conversation

sigram
Copy link
Contributor

@sigram sigram commented Jun 30, 2025

https://issues.apache.org/jira/browse/SOLR-17804

Use a Supplier<CloudSolrClient> that automatically re-creates the client if its ClusterStateProvider is closed. Unfortunately SolrClient doesn't implement SolrCloseable.

@github-actions github-actions bot added the tests label Jun 30, 2025
@dsmiley dsmiley changed the title SOLR-17084: re-create SolrClient if closed. SOLR-17804: re-create SolrClient if closed. Jun 30, 2025
@@ -32,6 +32,7 @@ dependencies {
implementation libs.dropwizard.metrics.servlets
implementation libs.eclipse.jetty.server
implementation libs.eclipse.jetty.ee10.servlet
implementation libs.google.guava
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need this anymore

Copy link
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

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

Other than the logs this looks ok to me. Have y'all tested this to make sure the handoff is smooth?

Also can we add some TODO comments that mention that we should be doing this in the client and not in the consumer eventually?

// refresh and check again
existingClient = solrClientRef.get();
if (existingClient.getClusterStateProvider().isClosed()) {
log.info("- re-creating Solr client because its CSP was closed");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make more normal log messages without -s and not abbreviating things like "CSP"?

Copy link
Contributor

Choose a reason for hiding this comment

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

This applies to all added log lines.

@sigram sigram merged commit 623159d into apache:main Jul 9, 2025
3 checks passed
sigram added a commit to sigram/solr that referenced this pull request Jul 9, 2025
sigram added a commit to sigram/solr that referenced this pull request Jul 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants