Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Mar 8, 2022

Conversation

apurtell
Copy link
Contributor

@apurtell apurtell commented Feb 19, 2022

[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.

Copy link
Contributor

@Apache9 Apache9 left a comment

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 int READ_TIMEOUT_MS = 2000;
private static final Random RNG = new Random();
Copy link
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()

Copy link
Contributor Author

@apurtell apurtell Feb 20, 2022

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
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
Contributor Author

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 org.apache.hadoop.hbase.HConstants;
import org.apache.hbase.thirdparty.io.netty.util.internal.ThreadLocalRandom;
Copy link
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
Contributor Author

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...

final BloomType[] bloomArray = BloomType.values();
final int bloomArraySize = bloomArray.length;

getLogger().info("Performing action: Change bloom filter on all columns of table " + tableName);

modifyAllTableColumns(tableName, (columnName, columnBuilder) -> {
BloomType bloomType = bloomArray[random.nextInt(bloomArraySize)];
BloomType bloomType = bloomArray[RandomUtils.nextInt(0, bloomArraySize)];
Copy link
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?

@@ -57,7 +56,7 @@ public void perform() throws IOException {
// exception.
Algorithm algo;
do {
algo = possibleAlgos[random.nextInt(possibleAlgos.length)];
algo = possibleAlgos[RandomUtils.nextInt(0, possibleAlgos.length)];
Copy link
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
Contributor Author

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
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
Contributor Author

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

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 10s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 2s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 2m 35s master passed
+1 💚 compile 7m 7s master passed
+1 💚 checkstyle 3m 20s master passed
+1 💚 spotbugs 6m 41s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 2m 24s the patch passed
-1 ❌ compile 0m 25s hbase-it in the patch failed.
-0 ⚠️ javac 0m 18s hbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️ javac 0m 25s hbase-it in the patch failed.
-0 ⚠️ checkstyle 0m 18s hbase-common: The patch generated 3 new + 135 unchanged - 0 fixed = 138 total (was 135)
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-metrics
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 17s hbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-zookeeper
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-replication
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-balancer
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-http
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-asyncfs
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-procedure
-0 ⚠️ checkstyle 0m 42s hbase-server: The patch generated 7 new + 389 unchanged - 18 fixed = 396 total (was 407)
+1 💚 checkstyle 0m 13s hbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
-0 ⚠️ checkstyle 0m 11s hbase-testing-util: The patch generated 1 new + 142 unchanged - 0 fixed = 143 total (was 142)
-0 ⚠️ checkstyle 0m 14s hbase-it: The patch generated 3 new + 186 unchanged - 2 fixed = 189 total (was 188)
+1 💚 checkstyle 0m 10s The patch passed checkstyle in hbase-rest
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 11m 38s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotbugs 8m 17s the patch passed
_ Other Tests _
+1 💚 asflicense 2m 13s The patch does not generate ASF License warnings.
64m 0s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / cd45cad
Default Java AdoptOpenJDK-1.8.0_282-b08
compile https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-testing-util.txt
checkstyle https://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 count 60 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 58s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 3m 58s master passed
+1 💚 compile 5m 22s master passed
+1 💚 shadedjars 5m 52s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 59s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 3m 28s the patch passed
+1 💚 compile 4m 43s the patch passed
+1 💚 javac 4m 43s the patch passed
+1 💚 shadedjars 6m 51s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 4m 39s the patch passed
_ Other Tests _
+1 💚 unit 3m 22s hbase-common in the patch passed.
+1 💚 unit 0m 21s hbase-metrics in the patch passed.
+1 💚 unit 0m 53s hbase-hadoop-compat in the patch passed.
+1 💚 unit 2m 13s hbase-client in the patch passed.
+1 💚 unit 0m 43s hbase-zookeeper in the patch passed.
+1 💚 unit 0m 21s hbase-replication in the patch passed.
+1 💚 unit 18m 42s hbase-balancer in the patch passed.
+1 💚 unit 1m 5s hbase-http in the patch passed.
+1 💚 unit 1m 22s hbase-asyncfs in the patch passed.
+1 💚 unit 2m 45s hbase-procedure in the patch passed.
-1 ❌ unit 340m 41s hbase-server in the patch failed.
+1 💚 unit 26m 31s hbase-mapreduce in the patch passed.
+1 💚 unit 1m 45s hbase-testing-util in the patch passed.
+1 💚 unit 1m 1s hbase-it in the patch passed.
+1 💚 unit 6m 49s hbase-rest in the patch passed.
453m 34s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / cd45cad
Default Java AdoptOpenJDK-11.0.10+9
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/testReport/
Max. process+thread count 1945 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 8m 39s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for branch
+1 💚 mvninstall 3m 23s master passed
+1 💚 compile 4m 17s master passed
+1 💚 shadedjars 5m 26s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 24s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 2m 44s the patch passed
+1 💚 compile 4m 37s the patch passed
+1 💚 javac 4m 37s the patch passed
+1 💚 shadedjars 5m 42s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 18s the patch passed
_ Other Tests _
+1 💚 unit 2m 31s hbase-common in the patch passed.
+1 💚 unit 0m 20s hbase-metrics in the patch passed.
+1 💚 unit 0m 48s hbase-hadoop-compat in the patch passed.
+1 💚 unit 1m 54s hbase-client in the patch passed.
+1 💚 unit 0m 50s hbase-zookeeper in the patch passed.
+1 💚 unit 0m 36s hbase-replication in the patch passed.
+1 💚 unit 18m 49s hbase-balancer in the patch passed.
+1 💚 unit 0m 51s hbase-http in the patch passed.
+1 💚 unit 1m 36s hbase-asyncfs in the patch passed.
+1 💚 unit 2m 23s hbase-procedure in the patch passed.
-1 ❌ unit 352m 24s hbase-server in the patch failed.
+1 💚 unit 21m 26s hbase-mapreduce in the patch passed.
+1 💚 unit 1m 43s hbase-testing-util in the patch passed.
+1 💚 unit 0m 50s hbase-it in the patch passed.
+1 💚 unit 5m 29s hbase-rest in the patch passed.
457m 19s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / cd45cad
Default Java AdoptOpenJDK-1.8.0_282-b08
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/testReport/
Max. process+thread count 1881 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 40s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for branch
+1 💚 mvninstall 2m 41s master passed
+1 💚 compile 7m 2s master passed
+1 💚 checkstyle 2m 39s master passed
+1 💚 spotbugs 6m 0s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 9s Maven dependency ordering for patch
+1 💚 mvninstall 2m 22s the patch passed
-1 ❌ compile 0m 24s hbase-it in the patch failed.
-0 ⚠️ javac 0m 17s hbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️ javac 2m 10s hbase-server generated 1 new + 192 unchanged - 1 fixed = 193 total (was 193)
-0 ⚠️ javac 0m 24s hbase-it in the patch failed.
-0 ⚠️ checkstyle 0m 13s hbase-common: The patch generated 3 new + 135 unchanged - 0 fixed = 138 total (was 135)
+1 💚 checkstyle 0m 5s The patch passed checkstyle in hbase-metrics
+1 💚 checkstyle 0m 7s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 14s hbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚 checkstyle 0m 7s The patch passed checkstyle in hbase-zookeeper
+1 💚 checkstyle 0m 6s The patch passed checkstyle in hbase-replication
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-balancer
+1 💚 checkstyle 0m 7s The patch passed checkstyle in hbase-http
+1 💚 checkstyle 0m 6s The patch passed checkstyle in hbase-asyncfs
+1 💚 checkstyle 0m 7s The patch passed checkstyle in hbase-procedure
-0 ⚠️ checkstyle 0m 37s hbase-server: The patch generated 7 new + 389 unchanged - 18 fixed = 396 total (was 407)
+1 💚 checkstyle 0m 10s hbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
-0 ⚠️ checkstyle 0m 9s hbase-testing-util: The patch generated 1 new + 142 unchanged - 0 fixed = 143 total (was 142)
-0 ⚠️ checkstyle 0m 10s hbase-it: The patch generated 3 new + 186 unchanged - 2 fixed = 189 total (was 188)
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-rest
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 11m 57s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotbugs 7m 30s the patch passed
_ Other Tests _
+1 💚 asflicense 1m 40s The patch does not generate ASF License warnings.
60m 14s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / b81ddd8
Default Java AdoptOpenJDK-1.8.0_282-b08
compile https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-compile-javac-hbase-server.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/artifact/yetus-general-check/output/diff-checkstyle-hbase-testing-util.txt
checkstyle https://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 count 60 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 38s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 3m 29s master passed
+1 💚 compile 4m 37s master passed
+1 💚 shadedjars 4m 10s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 27s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 3m 15s the patch passed
+1 💚 compile 4m 42s the patch passed
+1 💚 javac 4m 42s the patch passed
+1 💚 shadedjars 4m 27s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 27s the patch passed
_ Other Tests _
+1 💚 unit 2m 50s hbase-common in the patch passed.
+1 💚 unit 0m 20s hbase-metrics in the patch passed.
+1 💚 unit 0m 56s hbase-hadoop-compat in the patch passed.
+1 💚 unit 2m 15s hbase-client in the patch passed.
+1 💚 unit 0m 41s hbase-zookeeper in the patch passed.
+1 💚 unit 0m 23s hbase-replication in the patch passed.
+1 💚 unit 18m 22s hbase-balancer in the patch passed.
+1 💚 unit 1m 0s hbase-http in the patch passed.
+1 💚 unit 1m 15s hbase-asyncfs in the patch passed.
+1 💚 unit 2m 18s hbase-procedure in the patch passed.
-1 ❌ unit 318m 39s hbase-server in the patch failed.
+1 💚 unit 19m 52s hbase-mapreduce in the patch passed.
+1 💚 unit 1m 23s hbase-testing-util in the patch passed.
+1 💚 unit 0m 52s hbase-it in the patch passed.
+1 💚 unit 4m 48s hbase-rest in the patch passed.
412m 1s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / b81ddd8
Default Java AdoptOpenJDK-11.0.10+9
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/testReport/
Max. process+thread count 1966 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 5s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 2m 34s master passed
+1 💚 compile 4m 4s master passed
+1 💚 shadedjars 3m 44s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 4s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 2m 24s the patch passed
+1 💚 compile 4m 5s the patch passed
+1 💚 javac 4m 5s the patch passed
+1 💚 shadedjars 3m 46s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 10s the patch passed
_ Other Tests _
+1 💚 unit 2m 9s hbase-common in the patch passed.
+1 💚 unit 0m 17s hbase-metrics in the patch passed.
+1 💚 unit 0m 44s hbase-hadoop-compat in the patch passed.
+1 💚 unit 1m 38s hbase-client in the patch passed.
+1 💚 unit 0m 43s hbase-zookeeper in the patch passed.
+1 💚 unit 0m 34s hbase-replication in the patch passed.
+1 💚 unit 17m 22s hbase-balancer in the patch passed.
+1 💚 unit 0m 46s hbase-http in the patch passed.
+1 💚 unit 1m 20s hbase-asyncfs in the patch passed.
+1 💚 unit 1m 58s hbase-procedure in the patch passed.
-1 ❌ unit 348m 23s hbase-server in the patch failed.
+1 💚 unit 23m 49s hbase-mapreduce in the patch passed.
+1 💚 unit 1m 29s hbase-testing-util in the patch passed.
+1 💚 unit 0m 52s hbase-it in the patch passed.
+1 💚 unit 5m 55s hbase-rest in the patch passed.
439m 57s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / b81ddd8
Default Java AdoptOpenJDK-1.8.0_282-b08
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/testReport/
Max. process+thread count 1824 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@Apache9 Apache9 left a comment

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!

@@ -2358,7 +2360,7 @@ public static void zero(byte[] b, int offset, int length) {
Arrays.fill(b, offset, offset + length, (byte) 0);
}

private static final SecureRandom RNG = new SecureRandom();
private static final Random RNG = new Random();
Copy link
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
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
Contributor Author

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
Contributor Author

apurtell commented Mar 7, 2022

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

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 23s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 3m 46s master passed
+1 💚 compile 10m 22s master passed
+1 💚 checkstyle 4m 8s master passed
+1 💚 spotbugs 8m 34s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 3m 16s the patch passed
-1 ❌ compile 0m 32s hbase-it in the patch failed.
-0 ⚠️ javac 0m 23s hbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️ javac 2m 38s hbase-server generated 1 new + 192 unchanged - 1 fixed = 193 total (was 193)
-0 ⚠️ javac 0m 32s hbase-it in the patch failed.
-0 ⚠️ checkstyle 0m 20s hbase-common: The patch generated 2 new + 132 unchanged - 3 fixed = 134 total (was 135)
+1 💚 checkstyle 0m 10s The patch passed checkstyle in hbase-metrics
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 23s hbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-zookeeper
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-replication
+1 💚 checkstyle 0m 12s The patch passed checkstyle in hbase-balancer
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-http
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-asyncfs
+1 💚 checkstyle 0m 12s The patch passed checkstyle in hbase-procedure
-0 ⚠️ checkstyle 0m 54s hbase-server: The patch generated 7 new + 389 unchanged - 18 fixed = 396 total (was 407)
+1 💚 checkstyle 0m 17s hbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
-0 ⚠️ checkstyle 0m 13s hbase-testing-util: The patch generated 1 new + 142 unchanged - 0 fixed = 143 total (was 142)
-0 ⚠️ checkstyle 0m 16s hbase-it: The patch generated 3 new + 186 unchanged - 2 fixed = 189 total (was 188)
+1 💚 checkstyle 0m 13s The patch passed checkstyle in hbase-rest
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 16m 11s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotbugs 11m 27s the patch passed
_ Other Tests _
+1 💚 asflicense 2m 23s The patch does not generate ASF License warnings.
85m 38s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / bcd9a9a
Default Java AdoptOpenJDK-1.8.0_282-b08
compile https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-compile-javac-hbase-server.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/patch-compile-hbase-it.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/artifact/yetus-general-check/output/diff-checkstyle-hbase-testing-util.txt
checkstyle https://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 count 60 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 48s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 18s Maven dependency ordering for branch
+1 💚 mvninstall 3m 50s master passed
+1 💚 compile 3m 53s master passed
+1 💚 shadedjars 4m 48s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 3m 31s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 3m 10s the patch passed
+1 💚 compile 4m 27s the patch passed
+1 💚 javac 4m 27s the patch passed
+1 💚 shadedjars 4m 23s patch has no errors when building our shaded downstream artifacts.
-0 ⚠️ javadoc 0m 15s hbase-common generated 2 new + 0 unchanged - 0 fixed = 2 total (was 0)
_ Other Tests _
+1 💚 unit 2m 27s hbase-common in the patch passed.
+1 💚 unit 0m 20s hbase-metrics in the patch passed.
+1 💚 unit 0m 49s hbase-hadoop-compat in the patch passed.
+1 💚 unit 1m 56s hbase-client in the patch passed.
+1 💚 unit 0m 40s hbase-zookeeper in the patch passed.
+1 💚 unit 0m 30s hbase-replication in the patch passed.
+1 💚 unit 18m 57s hbase-balancer in the patch passed.
+1 💚 unit 0m 52s hbase-http in the patch passed.
+1 💚 unit 1m 12s hbase-asyncfs in the patch passed.
+1 💚 unit 2m 21s hbase-procedure in the patch passed.
-1 ❌ unit 345m 46s hbase-server in the patch failed.
+1 💚 unit 20m 20s hbase-mapreduce in the patch passed.
+1 💚 unit 1m 34s hbase-testing-util in the patch passed.
+1 💚 unit 0m 44s hbase-it in the patch passed.
+1 💚 unit 5m 34s hbase-rest in the patch passed.
440m 56s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / bcd9a9a
Default Java AdoptOpenJDK-1.8.0_282-b08
javadoc https://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
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/testReport/
Max. process+thread count 3479 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/3/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@apurtell
Copy link
Contributor Author

apurtell commented Mar 8, 2022

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

apurtell added 5 commits March 8, 2022 12:05
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
Contributor Author

apurtell commented Mar 8, 2022

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

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 58s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 26s Maven dependency ordering for branch
+1 💚 mvninstall 2m 57s master passed
+1 💚 compile 7m 55s master passed
+1 💚 checkstyle 3m 20s master passed
+1 💚 spotbugs 6m 35s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 2m 22s the patch passed
+1 💚 compile 7m 34s the patch passed
-0 ⚠️ javac 0m 19s hbase-asyncfs generated 1 new + 25 unchanged - 1 fixed = 26 total (was 26)
-0 ⚠️ javac 2m 11s hbase-server generated 1 new + 192 unchanged - 1 fixed = 193 total (was 193)
-0 ⚠️ javac 0m 26s hbase-it generated 2 new + 101 unchanged - 2 fixed = 103 total (was 103)
-0 ⚠️ checkstyle 0m 16s hbase-common: The patch generated 1 new + 132 unchanged - 3 fixed = 133 total (was 135)
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-metrics
+1 💚 checkstyle 0m 10s The patch passed checkstyle in hbase-hadoop-compat
+1 💚 checkstyle 0m 17s hbase-client: The patch generated 0 new + 14 unchanged - 4 fixed = 14 total (was 18)
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-zookeeper
+1 💚 checkstyle 0m 8s The patch passed checkstyle in hbase-replication
+1 💚 checkstyle 0m 10s The patch passed checkstyle in hbase-balancer
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-http
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-asyncfs
+1 💚 checkstyle 0m 9s The patch passed checkstyle in hbase-procedure
+1 💚 checkstyle 0m 42s hbase-server: The patch generated 0 new + 405 unchanged - 18 fixed = 405 total (was 423)
+1 💚 checkstyle 0m 13s hbase-mapreduce: The patch generated 0 new + 85 unchanged - 1 fixed = 85 total (was 86)
+1 💚 checkstyle 0m 12s The patch passed checkstyle in hbase-testing-util
-0 ⚠️ checkstyle 0m 14s hbase-it: The patch generated 2 new + 186 unchanged - 2 fixed = 188 total (was 188)
+1 💚 checkstyle 0m 11s The patch passed checkstyle in hbase-rest
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 11m 20s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotbugs 8m 17s the patch passed
_ Other Tests _
+1 💚 asflicense 2m 13s The patch does not generate ASF License warnings.
65m 8s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 39ecaa1
Default Java AdoptOpenJDK-1.8.0_282-b08
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-compile-javac-hbase-asyncfs.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-compile-javac-hbase-server.txt
javac https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-compile-javac-hbase-it.txt
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/artifact/yetus-general-check/output/diff-checkstyle-hbase-common.txt
checkstyle https://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 count 61 (vs. ulimit of 30000)
modules C: 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 output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4118/4/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@apurtell apurtell merged commit 1047194 into apache:master Mar 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 free to 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