You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by nkalmar <gi...@git.apache.org> on 2018/09/03 13:52:32 UTC
[GitHub] zookeeper pull request #617: ZOOKEEPER-1990 - fix Random instances
GitHub user nkalmar opened a pull request:
https://github.com/apache/zookeeper/pull/617
ZOOKEEPER-1990 - fix Random instances
See the jira for more info.
Basically we have multiple ways of creating Random instances in ZooKeeper. Since java 1.7, the default constructor is good enough even in multi-threaded environment, we get a good seed.
But in some places, we just create a random instance, where System.nanotime is the seed, which is not a good practice in multi-threaded environments.
I only replaced those, and I also left the tests as is, because in some cases it is intentional in them.
I created the PR to bring more attention to the ticket, please feel free to share your ideas on the topic!
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nkalmar/zookeeper ZOOKEEPER-1990
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/617.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #617
----
commit 4bbb8470ecd1445761c1091c49b9188e15e8c06c
Author: Norbert Kalmar <nk...@...>
Date: 2018-09-03T13:49:26Z
ZOOKEEPER-1990 - fix Random instances
----
---
[GitHub] zookeeper issue #617: ZOOKEEPER-1990 - fix Random instances
Posted by anmolnar <gi...@git.apache.org>.
Github user anmolnar commented on the issue:
https://github.com/apache/zookeeper/pull/617
Committed to branch-3.5 and master.
Thanks @nkalmar !
---
[GitHub] zookeeper issue #617: ZOOKEEPER-1990 - fix Random instances
Posted by edwardoliveira <gi...@git.apache.org>.
Github user edwardoliveira commented on the issue:
https://github.com/apache/zookeeper/pull/617
+1
---
[GitHub] zookeeper pull request #617: ZOOKEEPER-1990 - fix Random instances
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/zookeeper/pull/617
---