Akshat-Jain commented on code in PR #17466:
URL: https://github.com/apache/druid/pull/17466#discussion_r1841897916


##########
server/src/main/java/org/apache/druid/curator/discovery/CuratorDruidLeaderSelector.java:
##########
@@ -58,7 +59,7 @@ public class CuratorDruidLeaderSelector implements 
DruidLeaderSelector
   private final AtomicReference<LeaderLatch> leaderLatch = new 
AtomicReference<>();
 
   private volatile boolean leader = false;
-  private volatile int term = 0;
+  private final AtomicInteger term = new AtomicInteger(0);

Review Comment:
   It's a spotbugs pattern name called `VO_VOLATILE_INCREMENT`: 
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#vo-an-increment-to-a-volatile-field-isn-t-atomic-vo-volatile-increment



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to