Skip to content

HBASE-26582 Prune use of Random and SecureRandom objects - #4118

Merged
apurtell merged 6 commits into
apache:masterfrom
apurtell:HBASE-26582
Mar 8, 2022
Merged

HBASE-26582 Prune use of Random and SecureRandom objects#4118
apurtell merged 6 commits into
apache:masterfrom
apurtell:HBASE-26582

Conversation

@apurtell

@apurtellapurtell commented Feb 19, 2022

Copy link
Copy Markdown
Contributor

[This change does not cause any test failures (when tested locally) but there are flaky tests failing on master branch, so expect precommit results to be unclean.]

Avoid the pattern where a Random object is allocated, used once or twice, and then left for GC. This pattern triggers warnings from some static analysis tools because this pattern leads to poor effective randomness. In a few cases we were legitimately suffering from this issue; in others a change is still good to reduce noise in analysis results.

Use ThreadLocalRandom where there is no requirement to set the seed to gain good reuse.

Where useful relax use of SecureRandom to simply Random or ThreadLocalRandom, which are unlikely to block if the system entropy pool is low, if we don't need crypographically strong randomness for the use case.
The exception to this is normalization of use of Bytes#random to fill byte arrays with randomness. Because Bytes#random may be used to generate key material it must be backed by SecureRandom.

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems we have several different patterns in the UT, for example, ThreadLocalRandom and RandomUtils in commons-lang3.

For me I would like to make them align and I prefer we use what we have in JDK first. But anyway, it will not introduce big problems and this is really a big patch so if you do not want to spend more time on this, I'm also OK.

And please clean up the ThreadLocalRandom imports from netty.

Thanks @apurtell for the great and hard work.

private static Class<? extends Channel> CHANNEL_CLASS;

private static int READ_TIMEOUT_MS = 2000;
private static final Random RNG = new Random();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As said in the previous PR, let's just use ThreadLocalRandom.current()

@apurtellapurtellFeb 20, 2022

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. The caveat for replacing Random with TLR is where the existing test code calls setSeed() for whatever reason. TLR doesn't work for these cases because TLR doesn't support setSeed(). Some tests depend on setting the seed, HFile tests come to mind, and sometimes they don't. I can be more aggressive in switching to TLR where we don't really need to call setSeed. It's an option. YDYT @Apache9 ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setSeed could make the Random always give the same sequence, which could make the test more determined. So maybe for now let's just follow these rules:

  1. By default, we will replace Random with ThreadLocalRandom.
  2. If there is a setSeed call, then
    a. If the seed is just System.currentTimeMillis, then just replace it with ThreadLocalRandom.
    b. Otherwise, keep the old behavior, call setSeed on the Random object.

WDYT? Thanks.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes @Apache9 that's what I've done :-)

import java.util.Random;

import org.apache.hadoop.hbase.HConstants;
import org.apache.hbase.thirdparty.io.netty.util.internal.ThreadLocalRandom;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java.util.concurrent.ThreadLocalRandom. Maybe we should ban this import in maven enforcer to avoid typo.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, thanks, will check each diff where this may have happened...


modifyAllTableColumns(tableName, (columnName, columnBuilder) -> {
BloomType bloomType = bloomArray[random.nextInt(bloomArraySize)];
BloomType bloomType = bloomArray[RandomUtils.nextInt(0, bloomArraySize)];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could also use ThreadLocalRandom.current().nextInt here?

Algorithm algo;
do {
algo = possibleAlgos[random.nextInt(possibleAlgos.length)];
algo = possibleAlgos[RandomUtils.nextInt(0, possibleAlgos.length)];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ThreadLocalRandom.current()? Let's follow the same pattern.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Seems we have several different patterns in the UT, for example, ThreadLocalRandom and RandomUtils in commons-lang3.

Right, RandomUtils is very common in hbase-it, and not common outside of that module. I preferred to keep to the current practice in the module. However...

For me I would like to make them align and I prefer we use what we have in JDK first. But anyway, it will not introduce big problems and this is really a big patch so if you do not want to spend more time on this, I'm also OK.

Thanks for giving me an out here but this kind of cleanup work I think is the place to realign our practices to what we think are best. I agree we can prefer what is in the JDK to a third party dependency. That seems like a good policy to me. I will update the patch.

@joshelser

Copy link
Copy Markdown
Member

Thanks for taking this work on, Andrew. Duo's suggestion makes sense to me. I know this is quite a burden to update all of this.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Updated.

  • Rebased
  • Remove use of RandomUtils
  • Fix issues pointed out by Duo
  • Add Bytes#secureRandom and use it only where required; otherwise use Bytes#random which does not use a secure RNG

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 10sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 2sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for branch
+1 💚mvninstall2m 35smaster passed
+1 💚compile7m 7smaster passed
+1 💚checkstyle3m 20smaster passed
+1 💚spotbugs6m 41smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall2m 24sthe patch passed
-1 ❌compile0m 25shbase-it in the patch failed.
-0 ⚠️javac0m 18shbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️javac0m 25shbase-it in the patch failed.
-0 ⚠️checkstyle0m 18shbase-common: The patch generated 3 new + 135 unchanged - 0 fixed = 138 total (was 135)
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-metrics
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-hadoop-compat
+1 💚checkstyle0m 17shbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-zookeeper
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-replication
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-balancer
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-http
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-asyncfs
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-procedure
-0 ⚠️checkstyle0m 42shbase-server: The patch generated 7 new + 389 unchanged - 18 fixed = 396 total (was 407)
+1 💚checkstyle0m 13shbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
-0 ⚠️checkstyle0m 11shbase-testing-util: The patch generated 1 new + 142 unchanged - 0 fixed = 143 total (was 142)
-0 ⚠️checkstyle0m 14shbase-it: The patch generated 3 new + 186 unchanged - 2 fixed = 189 total (was 188)
+1 💚checkstyle0m 10sThe patch passed checkstyle in hbase-rest
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck11m 38sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotbugs8m 17sthe patch passed
_ Other Tests _
+1 💚asflicense2m 13sThe patch does not generate ASF License warnings.
64m 0s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4118
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
unameLinux 4583c954f810 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / cd45cad
Default JavaAdoptOpenJDK-1.8.0_282-b08
compilehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-testing-util.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-it.txt
Max. process+thread count60 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 58sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for branch
+1 💚mvninstall3m 58smaster passed
+1 💚compile5m 22smaster passed
+1 💚shadedjars5m 52sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 59smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 28sthe patch passed
+1 💚compile4m 43sthe patch passed
+1 💚javac4m 43sthe patch passed
+1 💚shadedjars6m 51spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc4m 39sthe patch passed
_ Other Tests _
+1 💚unit3m 22shbase-common in the patch passed.
+1 💚unit0m 21shbase-metrics in the patch passed.
+1 💚unit0m 53shbase-hadoop-compat in the patch passed.
+1 💚unit2m 13shbase-client in the patch passed.
+1 💚unit0m 43shbase-zookeeper in the patch passed.
+1 💚unit0m 21shbase-replication in the patch passed.
+1 💚unit18m 42shbase-balancer in the patch passed.
+1 💚unit1m 5shbase-http in the patch passed.
+1 💚unit1m 22shbase-asyncfs in the patch passed.
+1 💚unit2m 45shbase-procedure in the patch passed.
-1 ❌unit340m 41shbase-server in the patch failed.
+1 💚unit26m 31shbase-mapreduce in the patch passed.
+1 💚unit1m 45shbase-testing-util in the patch passed.
+1 💚unit1m 1shbase-it in the patch passed.
+1 💚unit6m 49shbase-rest in the patch passed.
453m 34s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4118
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 7bd475210b76 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / cd45cad
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/testReport/
Max. process+thread count1945 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec8m 39sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 23smaster passed
+1 💚compile4m 17smaster passed
+1 💚shadedjars5m 26sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 24smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall2m 44sthe patch passed
+1 💚compile4m 37sthe patch passed
+1 💚javac4m 37sthe patch passed
+1 💚shadedjars5m 42spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 18sthe patch passed
_ Other Tests _
+1 💚unit2m 31shbase-common in the patch passed.
+1 💚unit0m 20shbase-metrics in the patch passed.
+1 💚unit0m 48shbase-hadoop-compat in the patch passed.
+1 💚unit1m 54shbase-client in the patch passed.
+1 💚unit0m 50shbase-zookeeper in the patch passed.
+1 💚unit0m 36shbase-replication in the patch passed.
+1 💚unit18m 49shbase-balancer in the patch passed.
+1 💚unit0m 51shbase-http in the patch passed.
+1 💚unit1m 36shbase-asyncfs in the patch passed.
+1 💚unit2m 23shbase-procedure in the patch passed.
-1 ❌unit352m 24shbase-server in the patch failed.
+1 💚unit21m 26shbase-mapreduce in the patch passed.
+1 💚unit1m 43shbase-testing-util in the patch passed.
+1 💚unit0m 50shbase-it in the patch passed.
+1 💚unit5m 29shbase-rest in the patch passed.
457m 19s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4118
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 93682eedbf5b 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / cd45cad
Default JavaAdoptOpenJDK-1.8.0_282-b08
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/testReport/
Max. process+thread count1881 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 40sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall2m 41smaster passed
+1 💚compile7m 2smaster passed
+1 💚checkstyle2m 39smaster passed
+1 💚spotbugs6m 0smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall2m 22sthe patch passed
-1 ❌compile0m 24shbase-it in the patch failed.
-0 ⚠️javac0m 17shbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️javac2m 10shbase-server generated 1 new + 192 unchanged - 1 fixed = 193 total (was 193)
-0 ⚠️javac0m 24shbase-it in the patch failed.
-0 ⚠️checkstyle0m 13shbase-common: The patch generated 3 new + 135 unchanged - 0 fixed = 138 total (was 135)
+1 💚checkstyle0m 5sThe patch passed checkstyle in hbase-metrics
+1 💚checkstyle0m 7sThe patch passed checkstyle in hbase-hadoop-compat
+1 💚checkstyle0m 14shbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚checkstyle0m 7sThe patch passed checkstyle in hbase-zookeeper
+1 💚checkstyle0m 6sThe patch passed checkstyle in hbase-replication
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-balancer
+1 💚checkstyle0m 7sThe patch passed checkstyle in hbase-http
+1 💚checkstyle0m 6sThe patch passed checkstyle in hbase-asyncfs
+1 💚checkstyle0m 7sThe patch passed checkstyle in hbase-procedure
-0 ⚠️checkstyle0m 37shbase-server: The patch generated 7 new + 389 unchanged - 18 fixed = 396 total (was 407)
+1 💚checkstyle0m 10shbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
-0 ⚠️checkstyle0m 9shbase-testing-util: The patch generated 1 new + 142 unchanged - 0 fixed = 143 total (was 142)
-0 ⚠️checkstyle0m 10shbase-it: The patch generated 3 new + 186 unchanged - 2 fixed = 189 total (was 188)
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-rest
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck11m 57sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotbugs7m 30sthe patch passed
_ Other Tests _
+1 💚asflicense1m 40sThe patch does not generate ASF License warnings.
60m 14s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4118
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
unameLinux bdc5ccb46a88 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b81ddd8
Default JavaAdoptOpenJDK-1.8.0_282-b08
compilehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-compile-javac-hbase-server.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-testing-util.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-it.txt
Max. process+thread count60 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 38sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for branch
+1 💚mvninstall3m 29smaster passed
+1 💚compile4m 37smaster passed
+1 💚shadedjars4m 10sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 27smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 15sthe patch passed
+1 💚compile4m 42sthe patch passed
+1 💚javac4m 42sthe patch passed
+1 💚shadedjars4m 27spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 27sthe patch passed
_ Other Tests _
+1 💚unit2m 50shbase-common in the patch passed.
+1 💚unit0m 20shbase-metrics in the patch passed.
+1 💚unit0m 56shbase-hadoop-compat in the patch passed.
+1 💚unit2m 15shbase-client in the patch passed.
+1 💚unit0m 41shbase-zookeeper in the patch passed.
+1 💚unit0m 23shbase-replication in the patch passed.
+1 💚unit18m 22shbase-balancer in the patch passed.
+1 💚unit1m 0shbase-http in the patch passed.
+1 💚unit1m 15shbase-asyncfs in the patch passed.
+1 💚unit2m 18shbase-procedure in the patch passed.
-1 ❌unit318m 39shbase-server in the patch failed.
+1 💚unit19m 52shbase-mapreduce in the patch passed.
+1 💚unit1m 23shbase-testing-util in the patch passed.
+1 💚unit0m 52shbase-it in the patch passed.
+1 💚unit4m 48shbase-rest in the patch passed.
412m 1s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4118
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 255299b51b4b 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b81ddd8
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/testReport/
Max. process+thread count1966 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 5sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for branch
+1 💚mvninstall2m 34smaster passed
+1 💚compile4m 4smaster passed
+1 💚shadedjars3m 44sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 4smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall2m 24sthe patch passed
+1 💚compile4m 5sthe patch passed
+1 💚javac4m 5sthe patch passed
+1 💚shadedjars3m 46spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 10sthe patch passed
_ Other Tests _
+1 💚unit2m 9shbase-common in the patch passed.
+1 💚unit0m 17shbase-metrics in the patch passed.
+1 💚unit0m 44shbase-hadoop-compat in the patch passed.
+1 💚unit1m 38shbase-client in the patch passed.
+1 💚unit0m 43shbase-zookeeper in the patch passed.
+1 💚unit0m 34shbase-replication in the patch passed.
+1 💚unit17m 22shbase-balancer in the patch passed.
+1 💚unit0m 46shbase-http in the patch passed.
+1 💚unit1m 20shbase-asyncfs in the patch passed.
+1 💚unit1m 58shbase-procedure in the patch passed.
-1 ❌unit348m 23shbase-server in the patch failed.
+1 💚unit23m 49shbase-mapreduce in the patch passed.
+1 💚unit1m 29shbase-testing-util in the patch passed.
+1 💚unit0m 52shbase-it in the patch passed.
+1 💚unit5m 55shbase-rest in the patch passed.
439m 57s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4118
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 8e404d8792f8 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b81ddd8
Default JavaAdoptOpenJDK-1.8.0_282-b08
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/testReport/
Max. process+thread count1824 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9Apache9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one minor question about the Bytes change. Otherwise LGTM.

Thanks Andrew for the hard work!

}

private static final SecureRandom RNG = new SecureRandom();
private static final Random RNG = new Random();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bytes is marked as IA.Public, so is it OK to change from SecureRandom to normal Random here?
I'm not saying we can not do this, as there is no change on the method signatures, just asking.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My interpretation is that private fields are not a part of our IA.Public interface. I approve of this change.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out @Apache9 . I think becasue we did not advertise the security of the underlying RNG on Bytes#random (like in javadoc) we are safe here. There should not be an assumption. The new Bytes#secureRandom does imply the underlying RNG is SecureRandom. I think this is an improvement. I will also update the javadoc of these methods to clarify.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

Updated javadoc as discussed, improved a couple of comments, rebased. Will merge soon unless objection.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 23sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall3m 46smaster passed
+1 💚compile10m 22smaster passed
+1 💚checkstyle4m 8smaster passed
+1 💚spotbugs8m 34smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall3m 16sthe patch passed
-1 ❌compile0m 32shbase-it in the patch failed.
-0 ⚠️javac0m 23shbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️javac2m 38shbase-server generated 1 new + 192 unchanged - 1 fixed = 193 total (was 193)
-0 ⚠️javac0m 32shbase-it in the patch failed.
-0 ⚠️checkstyle0m 20shbase-common: The patch generated 2 new + 132 unchanged - 3 fixed = 134 total (was 135)
+1 💚checkstyle0m 10sThe patch passed checkstyle in hbase-metrics
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-hadoop-compat
+1 💚checkstyle0m 23shbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-zookeeper
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-replication
+1 💚checkstyle0m 12sThe patch passed checkstyle in hbase-balancer
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-http
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-asyncfs
+1 💚checkstyle0m 12sThe patch passed checkstyle in hbase-procedure
-0 ⚠️checkstyle0m 54shbase-server: The patch generated 7 new + 389 unchanged - 18 fixed = 396 total (was 407)
+1 💚checkstyle0m 17shbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
-0 ⚠️checkstyle0m 13shbase-testing-util: The patch generated 1 new + 142 unchanged - 0 fixed = 143 total (was 142)
-0 ⚠️checkstyle0m 16shbase-it: The patch generated 3 new + 186 unchanged - 2 fixed = 189 total (was 188)
+1 💚checkstyle0m 13sThe patch passed checkstyle in hbase-rest
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck16m 11sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotbugs11m 27sthe patch passed
_ Other Tests _
+1 💚asflicense2m 23sThe patch does not generate ASF License warnings.
85m 38s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4118
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
unameLinux a00f0b306cb0 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / bcd9a9a
Default JavaAdoptOpenJDK-1.8.0_282-b08
compilehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-compile-javac-hbase-server.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-testing-util.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-it.txt
Max. process+thread count60 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 48sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for branch
+1 💚mvninstall3m 50smaster passed
+1 💚compile3m 53smaster passed
+1 💚shadedjars4m 48sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc3m 31smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall3m 10sthe patch passed
+1 💚compile4m 27sthe patch passed
+1 💚javac4m 27sthe patch passed
+1 💚shadedjars4m 23spatch has no errors when building our shaded downstream artifacts.
-0 ⚠️javadoc0m 15shbase-common generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
_ Other Tests _
+1 💚unit2m 27shbase-common in the patch passed.
+1 💚unit0m 20shbase-metrics in the patch passed.
+1 💚unit0m 49shbase-hadoop-compat in the patch passed.
+1 💚unit1m 56shbase-client in the patch passed.
+1 💚unit0m 40shbase-zookeeper in the patch passed.
+1 💚unit0m 30shbase-replication in the patch passed.
+1 💚unit18m 57shbase-balancer in the patch passed.
+1 💚unit0m 52shbase-http in the patch passed.
+1 💚unit1m 12shbase-asyncfs in the patch passed.
+1 💚unit2m 21shbase-procedure in the patch passed.
-1 ❌unit345m 46shbase-server in the patch failed.
+1 💚unit20m 20shbase-mapreduce in the patch passed.
+1 💚unit1m 34shbase-testing-util in the patch passed.
+1 💚unit0m 44shbase-it in the patch passed.
+1 💚unit5m 34shbase-rest in the patch passed.
440m 56s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4118
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 03c24ab5ceb9 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / bcd9a9a
Default JavaAdoptOpenJDK-1.8.0_282-b08
javadochttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-jdk8-hadoop3-check/output/diff-javadoc-javadoc-hbase-common.txt
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/testReport/
Max. process+thread count3479 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@apurtell

Copy link
Copy Markdown
ContributorAuthor

There are valid javadoc and checkstyle warnings and an error prone finding, addressing them shortly.

Avoid the pattern where a Random object is allocated, used once or twice, and
then left for GC. This pattern triggers warnings from some static analysis tools
because this pattern leads to poor effective randomness. In a few cases we were
legitimately suffering from this issue; in others a change is still good to
reduce noise in analysis results.
Use ThreadLocalRandom where there is no requirement to set the seed to gain
good reuse.
Where useful relax use of SecureRandom to simply Random or ThreadLocalRandom,
which are unlikely to block if the system entropy pool is low, if we don't need
crypographically strong randomness for the use case. The exception to this is
normalization of use of Bytes#random to fill byte arrays with randomness.
Because Bytes#random may be used to generate key material it must be backed by
SecureRandom.
@apurtell

Copy link
Copy Markdown
ContributorAuthor

Updates to fix some issues I introduced in the last round.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 58sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 26sMaven dependency ordering for branch
+1 💚mvninstall2m 57smaster passed
+1 💚compile7m 55smaster passed
+1 💚checkstyle3m 20smaster passed
+1 💚spotbugs6m 35smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall2m 22sthe patch passed
+1 💚compile7m 34sthe patch passed
-0 ⚠️javac0m 19shbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️javac2m 11shbase-server generated 1 new + 192 unchanged - 1 fixed = 193 total (was 193)
-0 ⚠️javac0m 26shbase-it generated 2 new + 101 unchanged - 2 fixed = 103 total (was 103)
-0 ⚠️checkstyle0m 16shbase-common: The patch generated 1 new + 132 unchanged - 3 fixed = 133 total (was 135)
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-metrics
+1 💚checkstyle0m 10sThe patch passed checkstyle in hbase-hadoop-compat
+1 💚checkstyle0m 17shbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-zookeeper
+1 💚checkstyle0m 8sThe patch passed checkstyle in hbase-replication
+1 💚checkstyle0m 10sThe patch passed checkstyle in hbase-balancer
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-http
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-asyncfs
+1 💚checkstyle0m 9sThe patch passed checkstyle in hbase-procedure
+1 💚checkstyle0m 42shbase-server: The patch generated 0 new + 405 unchanged - 18 fixed = 405 total (was 423)
+1 💚checkstyle0m 13shbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
+1 💚checkstyle0m 12sThe patch passed checkstyle in hbase-testing-util
-0 ⚠️checkstyle0m 14shbase-it: The patch generated 2 new + 186 unchanged - 2 fixed = 188 total (was 188)
+1 💚checkstyle0m 11sThe patch passed checkstyle in hbase-rest
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck11m 20sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotbugs8m 17sthe patch passed
_ Other Tests _
+1 💚asflicense2m 13sThe patch does not generate ASF License warnings.
65m 8s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4118
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
unameLinux 1ac75153ebcf 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 39ecaa1
Default JavaAdoptOpenJDK-1.8.0_282-b08
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-compile-javac-hbase-server.txt
javachttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-compile-javac-hbase-it.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstylehttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-checkstyle-hbase-it.txt
Max. process+thread count61 (vs. ulimit of 30000)
modulesC: hbase-common hbase-metrics hbase-hadoop-compat hbase-client hbase-zookeeper hbase-replication hbase-balancer hbase-http hbase-asyncfs hbase-procedure hbase-server hbase-mapreduce hbase-testing-util hbase-it hbase-rest U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@apurtell
apurtell merged commit 1047194 into apache:masterMar 8, 2022
@apurtell
apurtell deleted the HBASE-26582 branch March 8, 2022 21:49
asfgit pushed a commit that referenced this pull request Mar 8, 2022
Avoid the pattern where a Random object is allocated, used once or twice, and
then left for GC. This pattern triggers warnings from some static analysis tools
because this pattern leads to poor effective randomness. In a few cases we were
legitimately suffering from this issue; in others a change is still good to
reduce noise in analysis results.
Use ThreadLocalRandom where there is no requirement to set the seed to gain
good reuse.
Where useful relax use of SecureRandom to simply Random or ThreadLocalRandom,
which are unlikely to block if the system entropy pool is low, if we don't need
crypographically strong randomness for the use case. The exception to this is
normalization of use of Bytes#random to fill byte arrays with randomness.
Because Bytes#random may be used to generate key material it must be backed by
SecureRandom.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
asfgit pushed a commit that referenced this pull request Mar 9, 2022
Avoid the pattern where a Random object is allocated, used once or twice, and
then left for GC. This pattern triggers warnings from some static analysis tools
because this pattern leads to poor effective randomness. In a few cases we were
legitimately suffering from this issue; in others a change is still good to
reduce noise in analysis results.
Use ThreadLocalRandom where there is no requirement to set the seed to gain
good reuse.
Where useful relax use of SecureRandom to simply Random or ThreadLocalRandom,
which are unlikely to block if the system entropy pool is low, if we don't need
crypographically strong randomness for the use case. The exception to this is
normalization of use of Bytes#random to fill byte arrays with randomness.
Because Bytes#random may be used to generate key material it must be backed by
SecureRandom.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
Apache9 pushed a commit that referenced this pull request Mar 11, 2022
Avoid the pattern where a Random object is allocated, used once or twice, and
then left for GC. This pattern triggers warnings from some static analysis tools
because this pattern leads to poor effective randomness. In a few cases we were
legitimately suffering from this issue; in others a change is still good to
reduce noise in analysis results.
Use ThreadLocalRandom where there is no requirement to set the seed to gain
good reuse.
Where useful relax use of SecureRandom to simply Random or ThreadLocalRandom,
which are unlikely to block if the system entropy pool is low, if we don't need
crypographically strong randomness for the use case. The exception to this is
normalization of use of Bytes#random to fill byte arrays with randomness.
Because Bytes#random may be used to generate key material it must be backed by
SecureRandom.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Apr 4, 2024
Avoid the pattern where a Random object is allocated, used once or twice, and
then left for GC. This pattern triggers warnings from some static analysis tools
because this pattern leads to poor effective randomness. In a few cases we were
legitimately suffering from this issue; in others a change is still good to
reduce noise in analysis results.
Use ThreadLocalRandom where there is no requirement to set the seed to gain
good reuse.
Where useful relax use of SecureRandom to simply Random or ThreadLocalRandom,
which are unlikely to block if the system entropy pool is low, if we don't need
crypographically strong randomness for the use case. The exception to this is
normalization of use of Bytes#random to fill byte arrays with randomness.
Because Bytes#random may be used to generate key material it must be backed by
SecureRandom.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 2105170)
Change-Id: Iba9282f90a2bb0442db4def68c59e099db8a830a
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@apurtell@joshelser@Apache-HBase@ndimiduk@Apache9