Skip to content

HBASE-29390 Too many logs in AsyncBatchRpcRetryingCaller when hitting… #7105

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

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

Apache9
Copy link
Contributor

@Apache9 Apache9 commented Jun 13, 2025

… RegionTooBusyException

@Apache9 Apache9 self-assigned this Jun 13, 2025
@Apache9 Apache9 requested a review from Copilot June 13, 2025 15:28
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses excessive logging in AsyncBatchRpcRetryingCaller when many actions fail (e.g., due to RegionTooBusyException) by batching and sampling error logs, and adds a unit test to verify the new behavior.

  • Introduce a static, test-visible logException method to sample up to 3 action errors per region and emit a single WARN log.
  • Update onComplete to collect action-level exceptions in an IdentityHashMap and invoke the new sampling logger.
  • Refactor an existing WARN log call to use parameterized logging and adjust RegionRequest visibility for testing.
  • Add TestAsyncBatchRpcRetryingCaller to validate log sampling, level, and formatting via a mock appender.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java Added logException for batched error sampling, updated onComplete logic, refactored existing log warning, and changed RegionRequest visibility.
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncBatchRpcRetryingCaller.java New test class using a mock Log4j appender to assert sampling behavior, log level, and message content.
Comments suppressed due to low confidence (2)

hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java:232

  • [nitpick] Add a Javadoc comment to logException explaining its purpose, the meaning of startLogErrorsCnt, and the sampling behavior to make the API clearer for future maintainers.
static void logException(int tries, int startLogErrorsCnt, RegionRequest regionReq,

hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncBatchRpcRetryingCaller.java:232

  • [nitpick] The static logException overload shares its name with the existing instance-level logException. Consider renaming one (e.g., logSampledErrors) to reduce confusion.
static void logException(int tries, int startLogErrorsCnt, RegionRequest regionReq,

}
StringWriter sw = new StringWriter();
PrintWriter action2ErrorWriter = new PrintWriter(sw);
action2ErrorWriter.println();
Copy link
Preview

Copilot AI Jun 13, 2025

Choose a reason for hiding this comment

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

[nitpick] This initial println() call introduces a leading blank line in the logged message. If consistent log formatting is desired, consider removing or relocating it.

Suggested change
action2ErrorWriter.println();

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is intentional, to make the detailed exception information to a new line.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 29s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 3m 25s master passed
+1 💚 compile 0m 22s master passed
+1 💚 javadoc 0m 19s master passed
+1 💚 shadedjars 6m 9s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 17s the patch passed
+1 💚 compile 0m 21s the patch passed
+1 💚 javac 0m 21s the patch passed
+1 💚 javadoc 0m 16s the patch passed
+1 💚 shadedjars 6m 6s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 1m 38s hbase-client in the patch passed.
23m 33s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7105/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7105
Optional Tests javac javadoc unit compile shadedjars
uname Linux 0eab60cc3871 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 657bb63
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7105/4/testReport/
Max. process+thread count 336 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7105/4/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 28s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+1 💚 mvninstall 2m 54s master passed
+1 💚 compile 0m 48s master passed
+1 💚 checkstyle 0m 14s master passed
+1 💚 spotbugs 0m 40s master passed
+1 💚 spotless 0m 43s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 2m 56s the patch passed
+1 💚 compile 0m 47s the patch passed
+1 💚 javac 0m 47s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 15s the patch passed
+1 💚 spotbugs 0m 49s the patch passed
+1 💚 hadoopcheck 11m 22s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 42s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 9s The patch does not generate ASF License warnings.
30m 7s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7105/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7105
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux fe08a3a5de3e 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 657bb63
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 82 (vs. ulimit of 30000)
modules C: hbase-client U: hbase-client
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7105/4/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache9 Apache9 requested a review from NihalJain June 14, 2025 14:07
@NihalJain
Copy link
Contributor

+1, LGTM

@Apache9 Apache9 merged commit 387e213 into apache:master Jun 20, 2025
1 check passed
Apache9 added a commit that referenced this pull request Jun 20, 2025
… RegionTooBusyException (#7105)

Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 387e213)
Apache9 added a commit that referenced this pull request Jun 20, 2025
… RegionTooBusyException (#7105)

Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 387e213)
Apache9 added a commit that referenced this pull request Jun 20, 2025
… RegionTooBusyException (#7105)

Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 387e213)
Apache9 added a commit that referenced this pull request Jun 20, 2025
… RegionTooBusyException (#7105)

Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 387e213)
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.

3 participants