Skip to content

HBASE-30265 Fix flaky TestProcDispatcher.testRetryLimitOnConnClosedEr…#8439

Open
liuxiaocs7 wants to merge 1 commit into
apache:masterfrom
liuxiaocs7:HBASE-30265
Open

HBASE-30265 Fix flaky TestProcDispatcher.testRetryLimitOnConnClosedEr…#8439
liuxiaocs7 wants to merge 1 commit into
apache:masterfrom
liuxiaocs7:HBASE-30265

Conversation

@liuxiaocs7

@liuxiaocs7 liuxiaocs7 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Comment on lines -92 to -95
if (j >= 8 && j <= 13 || j >= 18 && j <= 23) {
throw ERRORS.get(ERROR_IDX.getAndIncrement() % ERRORS.size());
// Throw a connection error each attempt until the retry limit is exhausted (-> SCP). On the
// last attempt run the real open/close first so the region still recovers.
if (attempts++ >= failFastLimit - 1) {
FutureUtils.get(getRsAdmin().executeProcedures(request));
}
return FutureUtils.get(getRsAdmin().executeProcedures(request));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The judgment here is actually not stable enough

Copilot AI left a comment

Copy link
Copy Markdown

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 flakiness in TestProcDispatcher.testRetryLimitOnConnClosedErrors (HBASE-30265) by making the error-injection logic in the test RS procedure dispatcher deterministic and scoped to the specific table/operations under test, rather than relying on global call counts.

Changes:

  • Refactors RSProcDispatcher test dispatcher to inject connection errors for the next N open/close-region requests targeting a specific table, and to align retries with the configured fail-fast retry limit.
  • Hardens the test by resetting injection state after each test, properly closing Table resources, and extending waitFor timeouts to reduce timing-related flakes.
  • Minor cleanup: replaces the hard-coded fail-fast config key usage in the test with a shared constant and improves logging formatting.

Reviewed changes

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

File Description
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestProcDispatcher.java Makes the flaky test more robust via scoped injection control, proper resource cleanup, and longer wait timeouts.
hbase-server/src/test/java/org/apache/hadoop/hbase/util/RSProcDispatcher.java Reworks the test dispatcher to inject failures based on target table + request type, using the configured retry limit to reliably trigger SCP scheduling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants