Skip to content

[8.2] [MOD-12069] [MOD-12695] Add active_io_threads metric #7552

Merged
meiravgri merged 4 commits into8.2from
backport-7530-to-8.2
Nov 27, 2025
Merged

[8.2] [MOD-12069] [MOD-12695] Add active_io_threads metric #7552
meiravgri merged 4 commits into8.2from
backport-7530-to-8.2

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Nov 27, 2025

backport #7530 to 8.2

Note: In this version we only have one uv thread.


Note

Tracks active I/O thread callbacks in global stats and reports them under a new multi_threading.active_io_threads section in INFO MODULES, with supporting tests and debug hook.

  • Metrics/Stats:
    • Add MultiThreadingStats with active_io_threads to TotalGlobalStats (src/info/global_stats.h).
    • Implement GlobalStats_UpdateActiveIoThreads and GlobalStats_GetMultiThreadingStats (src/info/global_stats.c).
  • I/O Runtime/Work Queue:
    • Track active I/O callbacks by incrementing/decrementing active_io_threads in rqAsyncCb (src/coord/rmr/rq.c).
    • Add RQ_Debug_SetLoopReady() to mark loop ready and process pending queues; declare in rq.h.
  • INFO output:
    • Add multi_threading section with active_io_threads to INFO MODULES (src/info/info_redis/info_redis.c).
  • Tests/Utils:
    • Add C++ unit test validating metric during callback execution (tests/cpptests/test_cpp_io_runtime_ctx.cpp).
    • Add Python test ensuring INFO MODULES exposes search_multi_threading.search_active_io_threads and defaults to 0 (tests/pytests/test_info_modules.py).
    • Add RS::WaitForCondition helper for polling in tests (tests/cpptests/common.h).

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

@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.47%. Comparing base (3084e1b) to head (f846436).
⚠️ Report is 1 commits behind head on 8.2.

Additional details and impacted files
@@            Coverage Diff             @@
##              8.2    #7552      +/-   ##
==========================================
- Coverage   89.49%   89.47%   -0.03%     
==========================================
  Files         253      253              
  Lines       40971    40989      +18     
  Branches     3725     3725              
==========================================
+ Hits        36666    36673       +7     
- Misses       4256     4267      +11     
  Partials       49       49              
Flag Coverage Δ
flow 82.24% <83.33%> (-0.01%) ⬇️
unit 47.70% <72.22%> (+0.19%) ⬆️

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 requested a review from JoanFM November 27, 2025 15:15
@meiravgri meiravgri enabled auto-merge November 27, 2025 15:17
@meiravgri meiravgri added this pull request to the merge queue Nov 27, 2025
Merged via the queue into 8.2 with commit d75adea Nov 27, 2025
23 checks passed
@meiravgri meiravgri deleted the backport-7530-to-8.2 branch November 27, 2025 17:25
@meiravgri
Copy link
Collaborator Author

/backport

@redisearch-backport-pull-request
Copy link
Contributor

Backport failed for 2.8, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 2.8
git worktree add -d .worktree/backport-7552-to-2.8 origin/2.8
cd .worktree/backport-7552-to-2.8
git switch --create backport-7552-to-2.8
git cherry-pick -x d75adea13119115ecbb54f3264b587127e93e00a

redisearch-backport-pull-request bot pushed a commit that referenced this pull request Nov 27, 2025
* take things that has no diffrence

* remove unrelated changes in test_info_modules

* add io threads update to rqAsyncCb

* fix test

(cherry picked from commit d75adea)
@redisearch-backport-pull-request
Copy link
Contributor

Successfully created backport PR for 2.10:

meiravgri added a commit that referenced this pull request Dec 1, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 3, 2025
* backport #7552 to 2.8

* remove line from pytests

* fix test

* remove comment
github-merge-queue bot pushed a commit that referenced this pull request Dec 8, 2025
* [8.2] [MOD-12069] [MOD-12695] Add `active_io_threads` metric  (#7552)

* take things that has no diffrence

* remove unrelated changes in test_info_modules

* add io threads update to rqAsyncCb

* fix test

(cherry picked from commit d75adea)

* move tests to c

* fix test

* swtich orde

---------

Co-authored-by: meiravgri <[email protected]>
Co-authored-by: meiravgri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants