Skip to content

[8.2] [MOD-12069] Add *_pending_jobs metrics#7626

Merged
meiravgri merged 2 commits into8.2from
backport-7556-to-8.2
Dec 3, 2025
Merged

[8.2] [MOD-12069] Add *_pending_jobs metrics#7626
meiravgri merged 2 commits into8.2from
backport-7556-to-8.2

Conversation

@meiravgri
Copy link
Collaborator

@meiravgri meiravgri commented Dec 3, 2025

MOD-12069 Multi threaded section
MOD-12696 number of queries waiting in the shards queue
MOD-12697 number of pending jobs in “low priority queue”
MOD-12831 test_info_modules:test_pending_jobs_metrics_search Extend output on timeout

backport #7556 and #7609 to 8.2


Note

Add threadpool getters and INFO MODULES metrics for workers’ high/low priority pending jobs, with workers wrappers and new tests.

  • Stats/Threadpool:
    • Add redisearch_thpool_high_priority_pending_jobs and redisearch_thpool_low_priority_pending_jobs to fetch queue lengths (atomic reads).
  • Global Stats:
    • Extend MultiThreadingStats with workers_low_priority_pending_jobs and workers_high_priority_pending_jobs.
    • Update GlobalStats_GetMultiThreadingStats() to read workers’ active thread count and pending job counts without locking.
  • INFO output:
    • In multi_threading section, add search_workers_low_priority_pending_jobs and search_workers_high_priority_pending_jobs.
  • Workers API:
    • Add workersThreadPool_LowPriorityPendingJobsCount() and workersThreadPool_HighPriorityPendingJobsCount() wrappers.
  • Tests:
    • Add wait_for_condition helper.
    • Refactor worker-threads test and add tests validating pending jobs metrics for both FT.SEARCH and FT.AGGREGATE with paused/resumed workers.
    • Minor constants/imports adjustments in tests.

Written by Cursor Bugbot for commit a544a18. 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)
@github-actions github-actions bot added the size:M label Dec 3, 2025
…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 changed the title Backport-7556-to-8.2 [8.2] [MOD-12069] Add *_pending_jobs metrics Dec 3, 2025
@meiravgri meiravgri requested a review from JoanFM December 3, 2025 08:41
@meiravgri meiravgri enabled auto-merge December 3, 2025 08:49
@meiravgri meiravgri added this pull request to the merge queue Dec 3, 2025
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.50%. Comparing base (a8ecd32) to head (2e4a755).
⚠️ Report is 1 commits behind head on 8.2.

Additional details and impacted files
@@           Coverage Diff           @@
##              8.2    #7626   +/-   ##
=======================================
  Coverage   89.50%   89.50%           
=======================================
  Files         253      253           
  Lines       41205    41219   +14     
  Branches     3725     3725           
=======================================
+ Hits        36879    36894   +15     
+ Misses       4277     4276    -1     
  Partials       49       49           
Flag Coverage Δ
flow 82.18% <100.00%> (-0.11%) ⬇️
unit 47.51% <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.

Merged via the queue into 8.2 with commit 5d8d367 Dec 3, 2025
23 checks passed
@meiravgri meiravgri deleted the backport-7556-to-8.2 branch December 3, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants