Repository navigation
Conversation
…ead array Thread.enumerate can fill fewer slots than the array has, when threads exit after activeCount. The test streamed all slots and failed with a NullPointerException on an empty slot. Read only the filled slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the test-only change that limits thread inspection to populated array slots.
No open issues 🎉
What changed in this PR
Fixes an intermittent null pointer exception in the metadata connection integration test without changing production code or weakening the assertion.
Changes:
- Captures the number of threads returned by
Thread.enumerate. - Counts matching threads only within populated array slots.
| File | Description |
|---|---|
| phoenix-core/src/it/java/org/apache/phoenix/end2end/MetadataServerConnectionsIT.java | Limits thread inspection to populated slots, avoiding null entries. |
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) |
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 view creation test fails sometimes in CI with a
Not allowederror from the test coprocessor. The coprocessor counts pool threads. It sizes an array from the active thread count and then fills the array. When threads exit between the two steps, the fill step uses fewer slots. The code reads all slots, so it throws a null pointer exception on an empty slot. The coprocessor catches the exception, logs an error without the exception, and returns the error.This change is test-only. The code now reads only the filled slots. The assertion is not weaker, because the old code checked the same filled slots.
🤖 Generated with Claude Code