Skip to content

[2.10] [MOD-12694] [MOD-12069] Add active_worker_threads metric#7688

Merged
meiravgri merged 5 commits into2.10from
backport-7538-to-2.10
Dec 10, 2025
Merged

[2.10] [MOD-12694] [MOD-12069] Add active_worker_threads metric#7688
meiravgri merged 5 commits into2.10from
backport-7538-to-2.10

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Dec 9, 2025

backport #7538 to 2.10


Note

Adds active_worker_threads to multi-threading stats and INFO output, wires it to workers thread pool, and updates/extends tests and helpers.

  • Metrics/Stats:
    • Add active_worker_threads to MultiThreadingStats (src/info/global_stats.h).
    • Populate via workersThreadPool_WorkingThreadCount() in GlobalStats_GetMultiThreadingStats() (src/info/global_stats.c, #ifdef MT_BUILD).
  • INFO Output:
    • Report active_worker_threads in AddToInfo_MultiThreading (src/info/info_redis.c).
  • Coordinator Unit Test:
    • Initialize/destroy workers thread pool around IO metric test (coord/src/rmr/test/test_io_runtime_ctx.c).
  • Test Utilities:
    • Add call_and_store helper and use it in debug tests (tests/pytests/common.py, tests/pytests/test_debug_commands.py).
  • Integration Tests:
    • Add/adjust INFO MODULES tests to verify multi_threading.active_worker_threads initialization and runtime behavior, including pause/resume and drain (tests/pytests/test_info_modules.py).

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

* add "active_worker_threads" metric

* fix declartion

* remove coord threads

* make the tests run...

* introduce workersThreadPool_isInitialized
assert is initizlied in GlobalStats_GetMultiThreadingStats

* cleanup

* rename workersThreadPool_isCreated

* Unskip test_active_io_threads_stats

Removed skip decorator from test_active_io_threads_stats.

(cherry picked from commit d9574d8)
@meiravgri meiravgri changed the title [2.10] [MOD-12694] [MOD-12069] Add active_worker_threads metric (#7538) [2.10] [MOD-12694] [MOD-12069] Add active_worker_threads metric Dec 9, 2025
@meiravgri meiravgri requested a review from lerman25 December 9, 2025 08:55
t = threading.Thread(
target=call_and_store,
args=(runDebugQueryCommandPauseBeforeRPAfterN,
(env, [query_type, 'idx', '*'], 'Index', 0, ['INTERNAL_ONLY']),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Test incorrectly passes INTERNAL_ONLY for FT.SEARCH queries

The test_active_worker_threads test always passes ['INTERNAL_ONLY'] as extra_args for both FT.SEARCH and FT.AGGREGATE query types. Based on the established pattern in test_debug_commands.py (lines 1098 and 1223), INTERNAL_ONLY should only be passed when query_type == 'FT.AGGREGATE'. Passing it for FT.SEARCH queries is inconsistent with other tests and may cause unexpected test behavior.

Fix in Cursor Fix in Web

@meiravgri meiravgri enabled auto-merge December 9, 2025 09:03
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.42%. Comparing base (698c3bb) to head (5530c52).
⚠️ Report is 5 commits behind head on 2.10.

Additional details and impacted files
@@            Coverage Diff             @@
##             2.10    #7688      +/-   ##
==========================================
- Coverage   89.44%   89.42%   -0.03%     
==========================================
  Files         210      210              
  Lines       36010    36025      +15     
==========================================
+ Hits        32210    32214       +4     
- Misses       3800     3811      +11     
Flag Coverage Δ
flow 84.06% <100.00%> (-0.15%) ⬇️
unit 42.12% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@meiravgri meiravgri added this pull request to the merge queue Dec 10, 2025
Merged via the queue into 2.10 with commit e7312a8 Dec 10, 2025
17 checks passed
@meiravgri meiravgri deleted the backport-7538-to-2.10 branch December 10, 2025 10: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