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/12/28 08:52:25 UTC

[GitHub] [zookeeper] tisonkun opened a new pull request, #1968: Cleanup code in the DataTree class

tisonkun opened a new pull request, #1968:
URL: https://github.com/apache/zookeeper/pull/1968

   Today I read the `DataTree` class and do these cleanups along with the path.
   
   cc @symat @eolivelli 


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


[GitHub] [zookeeper] tisonkun commented on pull request #1968: [ZOOKEEPER-4677] Cleanup code in the DataTree class

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1968:
URL: https://github.com/apache/zookeeper/pull/1968#issuecomment-1444895327

   @eolivelli ticket created. Commit title should be default to PR title if you merge from WebUI.


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


[GitHub] [zookeeper] sonatype-lift[bot] commented on a diff in pull request #1968: Cleanup code in the DataTree class

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #1968:
URL: https://github.com/apache/zookeeper/pull/1968#discussion_r1058190304


##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java:
##########
@@ -781,7 +773,7 @@ public List<ACL> getACL(String path, Stat stat) throws KeeperException.NoNodeExc
             if (stat != null) {
                 n.copyStat(stat);
             }
-            return new ArrayList<ACL>(aclCache.convertLong(n.acl));
+            return new ArrayList<>(aclCache.convertLong(n.acl));

Review Comment:
   <picture><img alt="20% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/20/display.svg"></picture>
   
   đŸ’Ŧ 5 similar findings have been found in this PR
   
   ---
   
   *THREAD_SAFETY_VIOLATION:*  Read/Write race. Non-private method `DataTree.getACL(...)` indirectly reads with synchronization from container `this.aclCache.longKeyMap` via call to `Map.get(...)`. Potentially races with unsynchronized write in method `DataTree.deserialize(...)`.
    Reporting because this access may occur on a background thread.
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | [1467](https://github.com/apache/zookeeper/blob/f2bc11c557676e8983bd501c0eb03a67da30fa92/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L1467) |
   | zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | [195](https://github.com/apache/zookeeper/blob/f2bc11c557676e8983bd501c0eb03a67da30fa92/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L195) |
   | zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | [1368](https://github.com/apache/zookeeper/blob/f2bc11c557676e8983bd501c0eb03a67da30fa92/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L1368) |
   | zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | [1440](https://github.com/apache/zookeeper/blob/f2bc11c557676e8983bd501c0eb03a67da30fa92/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L1440) |
   | zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | [461](https://github.com/apache/zookeeper/blob/f2bc11c557676e8983bd501c0eb03a67da30fa92/zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java#L461) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/zookeeper/01GNBYXJDSMJ3R1WR62NJGA4AZ?t=Infer|THREAD_SAFETY_VIOLATION" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=364338927&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=364338927&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=364338927&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=364338927&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=364338927&lift_comment_rating=5) ]



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


[GitHub] [zookeeper] tisonkun merged pull request #1968: [ZOOKEEPER-4677] Cleanup code in the DataTree class

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #1968:
URL: https://github.com/apache/zookeeper/pull/1968


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


[GitHub] [zookeeper] tisonkun commented on pull request #1968: [ZOOKEEPER-4677] Cleanup code in the DataTree class

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1968:
URL: https://github.com/apache/zookeeper/pull/1968#issuecomment-1445355551

   @eolivelli Manually.


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


[GitHub] [zookeeper] tisonkun commented on pull request #1968: [ZOOKEEPER-4677] Cleanup code in the DataTree class

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #1968:
URL: https://github.com/apache/zookeeper/pull/1968#issuecomment-1445781398

   Merging...
   
   FYI I may take a look at sonatype-lift reports to see if we can fix or disable it, preventing merging patches with CI fails.


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


[GitHub] [zookeeper] eolivelli commented on pull request #1968: Cleanup code in the DataTree class

Posted by GitBox <gi...@apache.org>.
eolivelli commented on PR #1968:
URL: https://github.com/apache/zookeeper/pull/1968#issuecomment-1387083728

   @tisonkun can you please crate a JIRA and change the title and the commit message ?


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