songwanging created SOLR-8032:
---------------------------------

             Summary: unhandled exceptions
                 Key: SOLR-8032
                 URL: https://issues.apache.org/jira/browse/SOLR-8032
             Project: Solr
          Issue Type: Improvement
    Affects Versions: 5.1, 5.0
            Reporter: songwanging
            Priority: Minor


In method close() of class RecoveryStrategy 
(solr\core\src\java\org\apache\solr\cloud\RecoveryStrategy.java)

The catch block catch (NullPointerException e) performs no actions to handle 
its expected exception, which makes itself useless. 

To fix this bug, we should add more code into the catch block to handle this 
exception.

public void close() {
    close = true;
    try {
      prevSendPreRecoveryHttpUriRequest.abort();
    } catch (NullPointerException e) {
      // okay
    }
   ...
  }

==========
In method startLeaderInitiatedRecoveryOnReplicas() of class ElectionContext 
(\solr\core\src\java\org\apache\solr\cloud\ElectionContext.java)

The catch block catch (NoNodeException e) performs no actions to handle its 
expected exception, which makes itself useless. 

To fix this bug, we should add more code into the catch block to handle this 
exception.

 try {
        replicas = zkClient.getChildren(znodePath, null, false);
      } catch (NoNodeException nne) {
        // this can be ignored
      }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to