Skip to content

HBASE-28413 Fix race condition in TestCleanerChore.retriesIOExceptionInStatus - #5735

Open
ndimiduk wants to merge 2 commits into
apache:masterfrom
ndimiduk:28413-testcleanerchore-retriesioexception
Open

HBASE-28413 Fix race condition in TestCleanerChore.retriesIOExceptionInStatus#5735
ndimiduk wants to merge 2 commits into
apache:masterfrom
ndimiduk:28413-testcleanerchore-retriesioexception

Conversation

@ndimiduk

Copy link
Copy Markdown
Member

We occasionally get a test failure in TestCleanerChore.retriesIOExceptionInStatus. For example, from a recent PR build 0 on branch-2.6,

java.util.concurrent.ExecutionException: java.io.IOException: whomp whomp.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.apache.hadoop.hbase.master.cleaner.TestCleanerChore.retriesIOExceptionInStatus(TestCleanerChore.java:163)
...
Caused by: java.io.IOException: whomp whomp.
at org.apache.hadoop.hbase.master.cleaner.TestCleanerChore$1.listStatus(TestCleanerChore.java:134)
at org.apache.hadoop.hbase.master.cleaner.CleanerChore.traverseAndDelete(CleanerChore.java:475)
at org.apache.hadoop.hbase.master.cleaner.CleanerChore.lambda$chore$0(CleanerChore.java:258)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more

This looks like a race condition where the chore manages an entire execution between when the flag is flipped and when the test thread gets back around to continuing execution. Make the test a little more pessimistic about its view of the world.

…InStatus
We occasionally get a test failure in TestCleanerChore.retriesIOExceptionInStatus. For example,
from a recent PR build [0] on branch-2.6,
```
java.util.concurrent.ExecutionException: java.io.IOException: whomp whomp.
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
at org.apache.hadoop.hbase.master.cleaner.TestCleanerChore.retriesIOExceptionInStatus(TestCleanerChore.java:163)
...
Caused by: java.io.IOException: whomp whomp.
at org.apache.hadoop.hbase.master.cleaner.TestCleanerChore$1.listStatus(TestCleanerChore.java:134)
at org.apache.hadoop.hbase.master.cleaner.CleanerChore.traverseAndDelete(CleanerChore.java:475)
at org.apache.hadoop.hbase.master.cleaner.CleanerChore.lambda$chore$0(CleanerChore.java:258)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
... 1 more
```
This looks like a race condition where the chore manages an entire execution between when the flag
is flipped and when the test thread gets back around to continuing execution. Make the test a
little more pessimistic about its view of the world.
[0]: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5725/1/testReport/org.apache.hadoop.hbase.master.cleaner/TestCleanerChore/precommit_checks___yetus_jdk11_hadoop3_checks___retriesIOExceptionInStatus/
@ndimiduk

Copy link
Copy Markdown
MemberAuthor

Relates to test change introduced in #4730.

@ndimiduk
ndimiduk requested a review from Apache9March 1, 2024 07:04
@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

This comment was marked as outdated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 28sDocker 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 _
+1 💚mvninstall2m 55smaster passed
+1 💚compile2m 33smaster passed
+1 💚checkstyle0m 35smaster passed
+1 💚spotless0m 42sbranch has no errors when running spotless:check.
+1 💚spotbugs1m 29smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 55sthe patch passed
+1 💚compile2m 33sthe patch passed
+1 💚javac2m 33sthe patch passed
+1 💚checkstyle0m 35sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck5m 28sPatch does not cause any errors with Hadoop 3.3.6.
+1 💚spotless0m 43spatch has no errors when running spotless:check.
+1 💚spotbugs1m 44sthe patch passed
_ Other Tests _
+1 💚asflicense0m 9sThe patch does not generate ASF License warnings.
29m 46s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5735
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux d3170c72a1b5 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ede4ccd
Default JavaEclipse Adoptium-11.0.17+8
Max. process+thread count79 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/console
versionsgit=2.34.1 maven=3.8.6 spotbugs=4.7.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 37sDocker 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 _
+1 💚mvninstall3m 4smaster passed
+1 💚compile0m 55smaster passed
+1 💚shadedjars5m 13sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 30smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 51sthe patch passed
+1 💚compile0m 55sthe patch passed
+1 💚javac0m 55sthe patch passed
+1 💚shadedjars5m 12spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 29sthe patch passed
_ Other Tests _
-1 ❌unit31m 38shbase-server in the patch failed.
53m 15s
SubsystemReport/Notes
DockerClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#5735
Optional Testsjavac javadoc unit shadedjars compile
unameLinux ac8a42036405 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ede4ccd
Default JavaEclipse Adoptium-17.0.10+7
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/testReport/
Max. process+thread count1740 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/console
versionsgit=2.34.1 maven=3.8.6
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 26sDocker 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 _
+1 💚mvninstall2m 43smaster passed
+1 💚compile0m 37smaster passed
+1 💚shadedjars5m 29sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 23smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 26sthe patch passed
+1 💚compile0m 39sthe patch passed
+1 💚javac0m 39sthe patch passed
+1 💚shadedjars5m 28spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 21sthe patch passed
_ Other Tests _
+1 💚unit224m 47shbase-server in the patch passed.
247m 32s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5735
Optional Testsjavac javadoc unit shadedjars compile
unameLinux b57bb5079e58 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ede4ccd
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/testReport/
Max. process+thread count5216 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/console
versionsgit=2.34.1 maven=3.8.6
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 13sDocker 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 _
+1 💚mvninstall3m 6smaster passed
+1 💚compile0m 49smaster passed
+1 💚shadedjars5m 10sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 27smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 48sthe patch passed
+1 💚compile0m 49sthe patch passed
+1 💚javac0m 49sthe patch passed
+1 💚shadedjars5m 12spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 26sthe patch passed
_ Other Tests _
+1 💚unit224m 59shbase-server in the patch passed.
248m 24s
SubsystemReport/Notes
DockerClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5735
Optional Testsjavac javadoc unit shadedjars compile
unameLinux b62a25c5d62a 5.4.0-172-generic #190-Ubuntu SMP Fri Feb 2 23:24:22 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / ede4ccd
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/testReport/
Max. process+thread count5136 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5735/2/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
Contributor

The test is failing in jdk17 build?

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

I think that my fix is incomplete. Or there's something else disrupting the test harness. The test was terminated, interrupting the chore thread, while the waiter loop had only sat for 5 seconds.

2024-03-01T16:16:45,537 INFO [Time-limited test {}] hbase.Waiter(181): Waiting up to [180,000] milli-secs(wait.for.ratio=[1])
2024-03-01T16:16:50,538 INFO [cleaner.Chore.2 {}] cleaner.CleanerChore(265): Failed to traverse and delete the dir: /home/jenkins/jenkins-home/workspace/Base-PreCommit-GitHub-PR_PR-5735/yetus-jdk17-hadoop3-check/src/hbase-server/target/test-data/c58d0e04-c6be-93cf-6ca5-040d0c598291
java.lang.InterruptedException: null
...
2024-03-01T16:16:50,555 INFO [Time-limited test {}] hbase.ResourceChecker(175): after: master.cleaner.TestCleanerChore#retriesIOExceptionInStatus Thread=19 (was 12)
...

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

In fact, jenkins doesn't tell us which of these failed runs is the output we have in the unit test summary.

[ERROR] Errors: [ERROR] org.apache.hadoop.hbase.master.cleaner.TestCleanerChore.null
[ERROR] Run 1: TestCleanerChore.retriesIOExceptionInStatus:171 » TestTimedOut test timed out after 780 seconds
[ERROR] Run 2: TestCleanerChore.retriesIOExceptionInStatus:171 » TestTimedOut test timed out after 780 seconds
[INFO] [ERROR] org.apache.hadoop.hbase.master.cleaner.TestCleanerChore.retriesIOExceptionInStatus
[ERROR] Run 1: TestCleanerChore.retriesIOExceptionInStatus:220 » Execution java.io.IOException: whomp whomp.
[ERROR] Run 2: TestCleanerChore.retriesIOExceptionInStatus:171 » Interrupted
[ERROR] Run 3: TestCleanerChore.retriesIOExceptionInStatus:171 » Interrupted
[INFO] [INFO] [ERROR] Tests run: 1227, Failures: 0, Errors: 2, Skipped: 4

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

There is still a race.

[ERROR] org.apache.hadoop.hbase.master.cleaner.TestCleanerChore Time elapsed: 779.999 s <<< ERROR!
org.junit.runners.model.TestTimedOutException: test timed out after 780 seconds
at java.base@17.0.10/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@17.0.10/java.util.concurrent.locks.LockSupport.park(LockSupport.java:211)
at java.base@17.0.10/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:715)
at java.base@17.0.10/java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1047)
at java.base@17.0.10/java.util.concurrent.CountDownLatch.await(CountDownLatch.java:230)
at app//org.apache.hadoop.hbase.master.cleaner.TestCleanerChore.retriesIOExceptionInStatus(TestCleanerChore.java:171)

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.

4 participants

@ndimiduk@Apache-HBase@Apache9@NihalJain