Skip to content

PHOENIX-8095 MetadataServerConnectionsIT reads empty slots of the thread array - #2727

Open
apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-8095
Open

apurtell wants to merge 1 commit into
apache:masterfrom
apurtell:PHOENIX-8095

Conversation

@apurtell

@apurtell apurtell commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

The view creation test fails sometimes in CI with a Not allowed error 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

…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>

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.

🟢 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

@apurtell

apurtell commented Dec 4, 2026

Copy link
Copy Markdown
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)

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