Repository navigation
Conversation
… records them The client thread pool records the task execution and end-to-end times in afterExecute(). ThreadPoolExecutor calls afterExecute() after the task future completes. The client can therefore get the scan result and read the metrics before the pool thread records them. Under CPU load the woken client thread can preempt the pool thread, and the checks then find no sample. Wait, with a bounded poll, until the pool threads record the task times. Then make the existing checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-only change that waits for task-timing metrics before asserting their values.
No open issues 🎉
What changed in this PR
This test-only change addresses intermittent timing-metric assertions in PhoenixMetricsIT by waiting for pool threads to record task times. Production behavior is unchanged.
Changes:
- Adds bounded waits before global and request-level task-timing checks.
- Preserves existing assertions to detect incorrect metric values.
| File | Description |
|---|---|
| phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java | Waits for task timing metrics before asserting their values. |
Review effort: Balanced
|
Precommit note: the failures in this run are not related to this change. Each one is a known problem on master.
(Claude Code) |
|
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) |
The global query metrics test fails intermittently under CPU load at the check on the end-to-end task time. The client thread pool records task times only after the task future completes. Thus the client thread can get the scan result and read the metrics before the pool thread records them. The request-level check on task execution time has the same race. Query results are not affected.
The change is test-only. Before the existing checks, the test now waits, with a time limit, until the task timers record their values. If a value is too high, the existing check still fails. This change complements PHOENIX-8101, and the two patches apply in either order.
🤖 Generated with Claude Code