Patrick Hunt updated ZOOKEEPER-115:

    Status: Open  (was: Patch Available)

I see a small discrepancy:

Can setThreads ever be called with a null channel? (s parameter) There is a 
null check in setThreads that seems unnecessary. In toSend and 
receiveConnection methods we are opening a new channel. In the Listener.run() 
method we are doing an client = ss.accept() (may return null in certain 
circumstances), then calling client.socket() with no check for null, then 
passing client to setThreads. Should we remove the null check or is the accept 
returns null not being handled properly?

> Potential NPE in QuorumCnxManager
> ---------------------------------
>                 Key: ZOOKEEPER-115
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-115
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: quorum
>            Reporter: Patrick Hunt
>            Assignee: Flavio Paiva Junqueira
>         Attachments: ZOOKEEPER-115.patch
> Findbugs flagged this, notice that we are checking for null after using the 
> reference.
>                if (senderWorkerMap.get(s.socket().getInetAddress()) != null) {
>                     senderWorkerMap.get(s.socket().getInetAddress()).finish();
>                 }
>                 /*
>                  * Start new worker thread with a clean state.
>                  */
>                 if (s != null) {

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to