Skip to content

[2.8] [MOD-12069] [MOD-12695] Add active_io_threads metric#7597

Merged
meiravgri merged 4 commits into2.8from
backport-7552-to-2.8
Dec 3, 2025
Merged

[2.8] [MOD-12069] [MOD-12695] Add active_io_threads metric#7597
meiravgri merged 4 commits into2.8from
backport-7552-to-2.8

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Dec 1, 2025

Description

Backport of #7552 (originated from #7530) to 2.8.


Note

Adds an active_io_threads metric, exposes it under a new multi_threading INFO section, and updates the RQ work queue to maintain it with tests.

  • Metrics/Global Stats:
    • Add MultiThreadingStats with active_io_threads to global_stats.
    • Implement GlobalStats_UpdateActiveIoThreads(int) and GlobalStats_GetMultiThreadingStats().
  • Work Queue (coord/src/rmr/rq.c):
    • Instrument rqAsyncCb to GlobalStats_UpdateActiveIoThreads(±1) around callback execution.
  • INFO output:
    • Add multi_threading section with active_io_threads in src/info/info_redis.c.
  • Tests:
    • Add C unit test coord/src/rmr/test/test_io_runtime_ctx.c validating metric increases during a slow callback and returns to 0.
    • Add Python test tests/pytests/test_info_modules.py checking multi_threading section exists and active_io_threads starts at 0.

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

@meiravgri meiravgri changed the title backport #7552 to 2.8 [2.8] [MOD-12069] [MOD-12695] Add active_io_threads metric Dec 1, 2025
@meiravgri meiravgri enabled auto-merge December 1, 2025 16:32
@meiravgri meiravgri requested a review from JoanFM December 1, 2025 16:32
@codecov
Copy link

codecov bot commented Dec 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.54%. Comparing base (54602b1) to head (e8b3b6d).
⚠️ Report is 2 commits behind head on 2.8.

Additional details and impacted files
@@            Coverage Diff             @@
##              2.8    #7597      +/-   ##
==========================================
- Coverage   87.54%   87.54%   -0.01%     
==========================================
  Files         203      203              
  Lines       34924    34939      +15     
==========================================
+ Hits        30574    30587      +13     
- Misses       4350     4352       +2     
Flag Coverage Δ
flow 81.90% <100.00%> (-0.22%) ⬇️
unit 42.53% <66.66%> (+0.14%) ⬆️

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.

/* start the event loop side thread */
static void sideThread(void *arg) {
atomic_store(&loop_started, true); // Signal that loop thread is starting
while (1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do u have this loop? uv_run should be enough it actually runs the event loop

Copy link
Collaborator Author

@meiravgri meiravgri Dec 2, 2025

Choose a reason for hiding this comment

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

i copied from the production code 🤷


SEARCH_PREFIX = 'search_'

# @skip(cluster=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove commented out skip

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it was removed in the following pr so i kept it here to avoid conflicts but ill have conflicts anyway :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

Copy link
Collaborator

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

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

small comment, may be relevant for 2.10

@meiravgri meiravgri requested a review from JoanFM December 2, 2025 15:24
@meiravgri meiravgri added this pull request to the merge queue Dec 3, 2025
Merged via the queue into 2.8 with commit 6e7ed7f Dec 3, 2025
13 checks passed
@meiravgri meiravgri deleted the backport-7552-to-2.8 branch December 3, 2025 11:59
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