sonatype-lift[bot] commented on code in PR #1993:
URL: https://github.com/apache/zookeeper/pull/1993#discussion_r1148603332
##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java:
##########
@@ -781,6 +806,13 @@ protected void syncWithLeader(long newLeaderZxid) throws
Exception {
// We need to log the stuff that came in between the snapshot and the
uptodate
if (zk instanceof FollowerZooKeeperServer) {
+ // Reply queued ACKs that are generated before replying ACK of
NEWLEADER
+ for (QuorumPacket p : queuedAcksInSync) {
Review Comment:
<picture><img alt="6% of developers fix this issue"
src="https://lift.sonatype.com/api/commentimage/fixrate/6/display.svg"></picture>
<b>*THREAD_SAFETY_VIOLATION:</b>* Read/Write race. Non-private method
`Learner.syncWithLeader(...)` reads without synchronization from container
`this.queuedAcksInSync` via call to `ConcurrentLinkedQueue.iterator()`.
Potentially races with write in method `Learner.addQueuedAcksInSync(...)`.
Reporting because this access may occur on a background thread.
ââ <b>2 similar findings have been found in this PR</b>
<details><summary>đ Expand here to view all instances of this
finding</summary><br/>
<div align=\"center\">
| **File Path** | **Line Number** |
| ------------- | ------------- |
|
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java
|
[128](https://github.com/apache/zookeeper/blob/0dca8ef9e6ba391936b0029e1ecdb657e2e878ae/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java#L128)
|
|
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java
|
[814](https://github.com/apache/zookeeper/blob/0dca8ef9e6ba391936b0029e1ecdb657e2e878ae/zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/Learner.java#L814)
|
<p><a
href="https://lift.sonatype.com/results/github.com/apache/zookeeper/01GWFETAAMSNHQNHE9X585E487?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>âšī¸ Expand to see all <b>@sonatype-lift</b>
commands</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>
---
<b>Help us improve LIFT! (<i>Sonatype LiftBot external survey</i>)</b>
Was this a good recommendation for you? <sub><small>Answering this survey
will not impact your Lift settings.</small></sub>
[â[đ Not
relevant](https://www.sonatype.com/lift-comment-rating?comment=454402445&lift_comment_rating=1)
â] - [â[đ Won't
fix](https://www.sonatype.com/lift-comment-rating?comment=454402445&lift_comment_rating=2)
â] - [â[đ Not critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=454402445&lift_comment_rating=3)
â] - [â[đ Critical, will
fix](https://www.sonatype.com/lift-comment-rating?comment=454402445&lift_comment_rating=4)
â] - [â[đ Critical, fixing
now](https://www.sonatype.com/lift-comment-rating?comment=454402445&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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]