Skip to content

Fix THREAD_POOL_METRICS_INSTANCE macro using wrong metric#30621

Open
ellabaron-code wants to merge 1 commit intoyugabyte:masterfrom
Shopify:fix-threadpool-metrics-instance-macro
Open

Fix THREAD_POOL_METRICS_INSTANCE macro using wrong metric#30621
ellabaron-code wants to merge 1 commit intoyugabyte:masterfrom
Shopify:fix-threadpool-metrics-instance-macro

Conversation

@ellabaron-code
Copy link

@ellabaron-code ellabaron-code commented Mar 6, 2026

Summary

  • The first field in the THREAD_POOL_METRICS_INSTANCE macro was incorrectly using _run_time_us (duplicate of the third field) instead of _queue_length
  • This caused the queue_length metric to never be instantiated for thread pools

Test plan

  • Verified the macro fields match the THREAD_POOL_METRICS_DEFINE macro order: queue_length, queue_time_us, run_time_us
  • Built successfully with ./yb_build.sh release --ninja

Note

Low Risk
Low risk macro fix that only changes which metrics are instantiated for thread pools; primary impact is on metric visibility rather than runtime behavior.

Overview
Fixes THREAD_POOL_METRICS_INSTANCE in threadpool.h to instantiate the missing *_queue_length metric instead of duplicating *_run_time_us, aligning the instance macro with THREAD_POOL_METRICS_DEFINE so thread pools now publish queue length stats as intended.

Written by Cursor Bugbot for commit 02c724c. This will update automatically on new commits. Configure here.

The first field in the THREAD_POOL_METRICS_INSTANCE macro was
incorrectly using _run_time_us (duplicate of the third field)
instead of _queue_length, causing the queue_length metric to
never be instantiated for thread pools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant
Copy link

CLAassistant commented Mar 6, 2026

CLA assistant check
All committers have signed the CLA.

@hari90 hari90 requested a review from yusong-yan March 7, 2026 01:21
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