GitHub user kevpeek opened a pull request: https://github.com/apache/storm/pull/1790
STORM-2210 - remove array shuffle from ShuffleGrouping when counter resets to zero This Collection.shuffle is problematic for 2 reasons. (1) in the existing implementation, the code resets current to zero before doing the shuffle, which opens a window during which other threads may access the not-yet-reshuffled array (or the mid-shuffle array). (2) If we call Collection.shuffle() before resetting current to zero, there is still a chance that some other thread is being slow and trying to access one of the upper indexes. E.g. choices.get(size - 3). Shuffling the array first could cause this thread to get the post-shuffle value instead of the pre-shuffle value. You can merge this pull request into a Git repository by running: $ git pull https://github.com/kevpeek/storm STORM-2210 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/storm/pull/1790.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 #1790 ---- commit 980af8083aaf185fad3db476dd765abe4ea9cda4 Author: Kevin Peek <kp...@salesforce.com> Date: 2016-11-21T18:53:33Z remove array shuffle from ShuffleGrouping when counter resets to zero ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---