Skip to content

[2.10] backport #7556 pending workers + #7609 test fix#7738

Merged
meiravgri merged 3 commits into2.10from
backport-7556-to-2.10
Dec 11, 2025
Merged

[2.10] backport #7556 pending workers + #7609 test fix#7738
meiravgri merged 3 commits into2.10from
backport-7556-to-2.10

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Dec 10, 2025

#7556: MOD-12069 Add *_pending_jobs metrics
#7609: MOD-12831 test_info_modules:test_pending_jobs_metrics_search Extend output on timeout


Note

Adds high/low-priority workers pending-jobs metrics to INFO MODULES, backed by new thpool/workers accessors, and introduces tests/utilities validating these stats.

  • Metrics/INFO:
    • Add workers_low_priority_pending_jobs and workers_high_priority_pending_jobs to multi_threading section in INFO MODULES (src/info/global_stats.{c,h}, src/info/info_redis.c).
    • Extend MultiThreadingStats with corresponding fields and populate via workers threadpool without extra locking.
  • Threadpool/Workers:
    • New accessors in deps/thpool/thpool.{h,c}: redisearch_thpool_high_priority_pending_jobs and redisearch_thpool_low_priority_pending_jobs (atomic reads).
    • Expose counts in workers API (src/util/workers.{h,c}): workersThreadPool_HighPriorityPendingJobsCount, workersThreadPool_LowPriorityPendingJobsCount.
  • Tests/Utils:
    • Add helpers wait_for_condition and launch_cmds_in_bg_with_exception_check in tests/pytests/common.py.
    • Make load_vectors_to_redis accept dim and vec_field_name.
    • Extend tests/pytests/test_info_modules.py with multi-threading metrics validations (active threads and pending jobs for SEARCH/AGGREGATE).

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

* align info/* to active_coord

* add APIs to get queues length

* add to info

* fix

* test

* fix test

* catch general error

* rename

* fix moduleArgs

* rename

* rename test_active_worker_threads

* rename to wworketrs

(cherry picked from commit ea0476a)
…nd output on timeout (#7609)

* move queries to run_cmds_in_bg
add workers stats to state if will fail

* refcator run_cmds_in_bg

(cherry picked from commit 7db7c2e)
@meiravgri meiravgri requested a review from JoanFM December 10, 2025 17:49

def test_pending_jobs_metrics_aggregate():
env = Env(moduleArgs='DEFAULT_DIALECT 2')
_test_pending_jobs_metrics(env, 'AGGREGATE')
Copy link

Choose a reason for hiding this comment

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

Bug: Missing @skip(noWorkers=True) for worker-dependent tests

The new test functions test_pending_jobs_metrics_search and test_pending_jobs_metrics_aggregate require worker thread pool functionality but are missing the @skip(noWorkers=True) decorator. Other similar tests in this file like test_active_worker_threads (line 906) and test_counting_queries_BG (line 475) correctly use this decorator. Without it, these tests will fail in environments where workers support is not available (non-MT_BUILD configurations), as they attempt to configure workers, pause the worker thread pool, and check worker-specific metrics.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.43%. Comparing base (a4cb509) to head (b9e289a).
⚠️ Report is 3 commits behind head on 2.10.

Additional details and impacted files
@@            Coverage Diff             @@
##             2.10    #7738      +/-   ##
==========================================
- Coverage   89.45%   89.43%   -0.03%     
==========================================
  Files         210      210              
  Lines       36073    36087      +14     
==========================================
+ Hits        32270    32275       +5     
- Misses       3803     3812       +9     
Flag Coverage Δ
flow 84.09% <100.00%> (-0.14%) ⬇️
unit 42.12% <85.71%> (+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 11, 2025
Merged via the queue into 2.10 with commit 4e5b0f4 Dec 11, 2025
17 checks passed
@meiravgri meiravgri deleted the backport-7556-to-2.10 branch December 11, 2025 05:34
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