You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by GitBox <gi...@apache.org> on 2019/03/28 16:55:14 UTC
[GitHub] [zookeeper] lvfangmin commented on a change in pull request #869:
ZOOKEEPER-3020: Review of SyncRequestProcessor
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:
users@infra.apache.org
With regards,
Apache Git Services