markrmiller commented on a change in pull request #689: SOLR-13489: Stop the 
leader from trying to rejoin the election on ses…
URL: https://github.com/apache/lucene-solr/pull/689#discussion_r288640459
 
 

 ##########
 File path: solr/core/src/java/org/apache/solr/cloud/ZkController.java
 ##########
 @@ -368,8 +368,15 @@ public void command() {
               }
 
               cc.cancelCoreRecoveries();
-
-              registerAllCoresAsDown(registerOnReconnect, false);
+              
+              try {
+                registerAllCoresAsDown(registerOnReconnect, false);
+              } catch (SessionExpiredException e) {
+                // zk has to reconnect
+                throw e;
+              } catch (Exception e) {
+                log.warn("Exception while trying to register all cores as 
DOWN", e);
 
 Review comment:
   Only if it's a session expiration - if not, that is just a best effort call 
- it already ignores most exceptions internally, this is a fail safe as it can 
miss some stuff.
   
   Because of races and various things that can happen, this is really just 
best effort - we might even still end up being the leader. So we want to wait 
if it's working, but if it doesn't work, just like now, we still try and move 
on. This just makes that more clear and ensures it happens across more errors 
that can happen in the wait call.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to