You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Andrzej Bialecki (Jira)" <ji...@apache.org> on 2025/06/30 13:59:00 UTC

[jira] [Created] (SOLR-17804) CrossDC Consumer tries to reuse an already closed SolrClient

Andrzej Bialecki created SOLR-17804:
---------------------------------------

             Summary: CrossDC Consumer tries to reuse an already closed SolrClient
                 Key: SOLR-17804
                 URL: https://issues.apache.org/jira/browse/SOLR-17804
             Project: Solr
          Issue Type: Bug
          Components: module - crossDC
    Affects Versions: 9.8.1
            Reporter: Andrzej Bialecki
            Assignee: Andrzej Bialecki


When network is down for a while a CloudSolrClient used by the Consumer application becomes unusable because its ZkClientStateProvider gets closed:
{code:java}
272746 ERROR (KafkaCrossDcConsumerWorker) [n: c:ab-test s: r: x: t:] o.a.s.c.m.SolrMessageProcessor Unable to connect to solr server. Not consuming.                                                                                                    
          => org.apache.solr.common.AlreadyClosedException                                                                                                                                                                                                  
    at org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.getZkStateReader(ZkClientClusterStateProvider.java:222)                                                                                                                               
org.apache.solr.common.AlreadyClosedException: null                                                                                                                                                                                                         
    at org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.getZkStateReader(ZkClientClusterStateProvider.java:222)                                                                                          
    at org.apache.solr.client.solrj.impl.ZkClientClusterStateProvider.connect(ZkClientClusterStateProvider.java:217)                                                                                                 
    at org.apache.solr.client.solrj.impl.CloudSolrClient.connect(CloudSolrClient.java:364)                                                                                  
    at org.apache.solr.crossdc.messageprocessor.SolrMessageProcessor.connectToSolrIfNeeded(SolrMessageProcessor.java:363)                                                                                             
    at org.apache.solr.crossdc.messageprocessor.SolrMessageProcessor.handleItem(SolrMessageProcessor.java:74)                                                                                                        
    at org.apache.solr.crossdc.consumer.KafkaCrossDcConsumer.lambda$sendBatch$2(KafkaCrossDcConsumer.java:375)                                                                                                       
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]                                                                                                                                                                        
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]                                                                                                                                                                                       
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]                                                                                                                                                                
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]                                                                                                                                                                
    at java.lang.Thread.run(Thread.java:829) [?:?] {code}
The Consumer keeps trying to use this client instance, which results in multiple errors and no recovery without restarting the Consumer application.

The immediate fix is for the Consumer to try to recover from this state by re-creating the SolrClient.

A broader question (to address in another ticket) is what should be the proper behavior of CloudSolrClient when its ClusterStateProvider gets closed - IMHO the client should be closed too.

 



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

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