-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZOOKEEPER-4677] Cleanup code in the DataTree class #1968
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@@ -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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 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.
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | 1467 |
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | 195 |
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | 1368 |
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | 1440 |
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java | 461 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
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.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@tisonkun can you please create a JIRA and change the title and the commit message ? |
@eolivelli ticket created. Commit title should be default to PR title if you merge from WebUI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
how did you create this patch ? manually or with a tool ?
@eolivelli Manually. |
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. |
Today I read the
DataTree
class and do these cleanups along with the path.cc @symat @eolivelli