lvfangmin commented on a change in pull request #869: ZOOKEEPER-3020: Review of
SyncRequestProcessor
URL: https://github.com/apache/zookeeper/pull/869#discussion_r270099253
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java
##########
@@ -102,103 +108,95 @@ public void run() {
// we do this in an attempt to ensure that not all of the servers
// in the ensemble take a snapshot at the same time
- int randRoll = r.nextInt(snapCount/2);
+ int randRoll = ThreadLocalRandom.current().nextInt(snapCount / 2,
snapCount);
Review comment:
I remember we changed to use Random from thread local once since it's
approximately giving the same randomize after JDK 8 if I remember correctly.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services