lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1239180 - /lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java
Date Wed, 01 Feb 2012 15:52:10 GMT
Author: markrmiller
Date: Wed Feb  1 15:52:10 2012
New Revision: 1239180

URL: http://svn.apache.org/viewvc?rev=1239180&view=rev
Log:
SOLR-3065: clean up exception handling / logging

Modified:
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java?rev=1239180&r1=1239179&r2=1239180&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/cloud/Overseer.java Wed Feb  1 15:52:10
2012
@@ -144,10 +144,16 @@ public class Overseer implements NodeSta
                     ZkStateReader.toJSON(cloudState), true);
 
               } catch (KeeperException e) {
-                // XXX stop processing, exit
-                return;
+                if (e.code() == KeeperException.Code.SESSIONEXPIRED
+                    || e.code() == KeeperException.Code.CONNECTIONLOSS) {
+                  log.warn("ZooKeeper watch triggered, but Solr cannot talk to ZK");
+                  return;
+                }
+                SolrException.log(log, "", e);
+                throw new ZooKeeperException(
+                    SolrException.ErrorCode.SERVER_ERROR, "", e);
               } catch (InterruptedException e) {
-                // XXX stop processing, exit
+                Thread.currentThread().interrupt();
                 return;
               }
             }
@@ -156,7 +162,7 @@ public class Overseer implements NodeSta
           try {
             Thread.sleep(STATE_UPDATE_DELAY);
           } catch (InterruptedException e) {
-            //
+            Thread.currentThread().interrupt();
           }
         }
       }
@@ -168,9 +174,9 @@ public class Overseer implements NodeSta
             return true;
           }
         } catch (KeeperException e) {
-          // assume we're dead
+          log.warn("", e);
         } catch (InterruptedException e) {
-          // assume we're dead
+          Thread.currentThread().interrupt();
         }
         log.info("According to ZK I (id=" + myId + ") am no longer a leader.");
         return false;



Mime
View raw message