zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] sonatype-lift[bot] commented on a change in pull request #1755: ZOOKEEPER-4367 Zookeeper#Login thread leak in case of Sasl AuthFailed.
Date Tue, 14 Sep 2021 20:44:43 GMT

sonatype-lift[bot] commented on a change in pull request #1755:
URL: https://github.com/apache/zookeeper/pull/1755#discussion_r708618407



##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
##########
@@ -1486,6 +1490,9 @@ public void sendPacket(Packet p) throws IOException {
             clientCnxnSocket.sendPacket(p);
         }
 
+        public ZooKeeperSaslClient getZooKeeperSaslClient() {
+            return zooKeeperSaslClient;

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Read/Write race. Non-private method `ClientCnxn$SendThread.getZooKeeperSaslClient()`
reads without synchronization from `this.zooKeeperSaslClient`. Potentially races with write
in method `ClientCnxn$SendThread.run()`.
    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`)

##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
##########
@@ -1313,6 +1313,10 @@ public void run() {
                 eventThread.queueEvent(new WatchedEvent(Event.EventType.None, Event.KeeperState.Disconnected,
null));
             }
             eventThread.queueEvent(new WatchedEvent(Event.EventType.None, Event.KeeperState.Closed,
null));
+
+            if (zooKeeperSaslClient != null) {

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Read/Write race. Non-private method `ClientCnxn$SendThread.run()`
reads without synchronization from `this.zooKeeperSaslClient`. Potentially races with write
in method `ClientCnxn$SendThread.run()`.
    Reporting because this access may occur on a background thread.
   (at-me [in a reply](https://help.sonatype.com/lift/talking-to-lift) with `help` or `ignore`)

##########
File path: zookeeper-server/src/main/java/org/apache/zookeeper/ClientCnxn.java
##########
@@ -1313,6 +1313,10 @@ public void run() {
                 eventThread.queueEvent(new WatchedEvent(Event.EventType.None, Event.KeeperState.Disconnected,
null));
             }
             eventThread.queueEvent(new WatchedEvent(Event.EventType.None, Event.KeeperState.Closed,
null));
+
+            if (zooKeeperSaslClient != null) {
+                zooKeeperSaslClient.shutdown();

Review comment:
       *THREAD_SAFETY_VIOLATION:*  Unprotected write. Non-private method `ClientCnxn$SendThread.run()`
indirectly writes to field `this.zooKeeperSaslClient.login` outside of synchronization.
    Reporting because this access may occur on a background thread.
   (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



Mime
View raw message