[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17518760#comment-17518760
 ] 

Mohammad Arshad commented on ZOOKEEPER-4514:
--------------------------------------------

NPE is thrown because channel object is null in 
ClientCnxnSocketNetty#sendPkt(Packet p, boolean doFlush) method.
We should do null check same like the null check done in 
sendPacket(ClientCnxn.Packet p) method. 

As sendPacket is delegating the call to sendPkt method, better we can move the 
null check to sendPkt method to handle all scenarios.

> ClientCnxnSocketNetty throwing NPE
> ----------------------------------
>
>                 Key: ZOOKEEPER-4514
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4514
>             Project: ZooKeeper
>          Issue Type: Bug
>            Reporter: Mohammad Arshad
>            Assignee: Mohammad Arshad
>            Priority: Major
>         Attachments: image-2022-04-07-13-27-13-068.png
>
>
> ClientCnxnSocketNetty throwing NPE. This mainly happens when any of the 
> server is in restarting state and client tries to connect.
>  !image-2022-04-07-13-27-13-068.png! 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to