Repository navigation
Conversation
Conn1's failure completes asynchronously on its single-thread executor, but the test checked it at once. The test could also restore the stub before conn1 ran its failing createStatement. Wait for conn1's chain to complete exceptionally before restoring the stub. After that, every later chain on conn1 fails at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The test-only synchronization change has no active review issues.
No open issues 🎉
What changed in this PR
Fixes an intermittent race in ParallelPhoenixConnectionFailureTest by synchronizing the test with asynchronous connection failure. Production behavior is unchanged.
Changes:
- Waits for the first connection’s chain to complete exceptionally before restoring its stub.
- Adds comments explaining why the wait is needed.
| File | Description |
|---|---|
| phoenix-core/src/test/java/org/apache/phoenix/jdbc/ParallelPhoenixConnectionFailureTest.java | Adds a bounded wait to make the query-chain failure check deterministic. |
Review effort: Balanced
Contributor
Author
|
Precommit note: the failures in this run are not related to this change. Each one is a known problem on master.
(Claude Code) |
Contributor
Author
|
Update to the precommit note above: the region server deadlock after a table split is now PHOENIX-8121, with the fix in #2753. The metadata call for one table now runs on the caller thread, so it does not wait in the connection thread pool. (Claude Code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test of the query chain failure fails intermittently under CPU load. Each call on the parallel connection adds a link to a chain for each connection, and each link runs on the single-thread executor of its cluster. The caller returns when the second connection succeeds. Thus the failing link on the first connection can still be queued or running when the test checks it. Also, if that link runs only after the test restores the stub, it succeeds and the chain never fails. The product is not at fault, because it drops a failed connection asynchronously by design.
The change is test-only. The test now waits until the chain of the first connection fails, and only then restores the stub. The check is then deterministic.
🤖 Generated with Claude Code