You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2022/04/07 10:29:31 UTC

[GitHub] [zookeeper] sonatype-lift[bot] commented on a diff in pull request #1854: ZOOKEEPER-4514: ClientCnxnSocketNetty throwing NPE

sonatype-lift[bot] commented on code in PR #1854:
URL: https://github.com/apache/zookeeper/pull/1854#discussion_r844976406


##########
zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxnSocketNetty.java:
##########
@@ -374,9 +377,6 @@ private void doWrite(Queue<Packet> pendingQueue, Packet p, ClientCnxn cnxn) {
 
     @Override
     void sendPacket(ClientCnxn.Packet p) throws IOException {
-        if (channel == null) {
-            throw new IOException("channel has been closed");
-        }
         sendPktAndFlush(p);

Review Comment:
   *THREAD_SAFETY_VIOLATION:*  Read/Write race. Non-private method `ClientCnxnSocketNetty.sendPacket(...)` indirectly reads without synchronization from `this.channel`. Potentially races with write in method `ClientCnxnSocketNetty.cleanup()`.
    Reporting because another access to the same memory occurs on a background thread, although this access may not.
   
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org