[8.4] [MOD-12252] [MOD-11658] reduce number of worker threads asynchronously#7519
Merged
[8.4] [MOD-12252] [MOD-11658] reduce number of worker threads asynchronously#7519
Conversation
#7410) * change number of threads asynchronously * do some changes to add thread * improve code * cancel old config change if happens * more improvements * destroy when sure noone needsit * simplify implementation drastically * improve async implementation * revert barrier changes * test: do not skip on standalone * test: add new test * fix tests * remove extra tests * remove unneeded code * delay ensure init after * fix: remove weird unlock * test: handle cpp tests * small improvement on the test * improve the checking of thread starting * remove some unneeded functions from thpool * remove unused code from tests * small cleanup of code * update deps/thpool/thpool.c * add checks to thpool stats in test * fix multithread test * fix memory leak and remove unreachable code * assert some invariants * fix: respect adding workers is a lazy operation even after start * small changes * remove double assertion * add another assertion * small change to avoid dangling pointer in stack * changes according to comments to the code * change tests of place and simplify some * small change * try to improve flakiness and test time using TimeLimit * make static and reuse code * Update deps/thpool/thpool.c Co-authored-by: GuyAv46 <[email protected]> * add volatile to started array * remove extra assertion * add warning to ft debug command code comment * change assertion method * remove flakiness from test * change test query while flush test * Update deps/thpool/thpool.c Co-authored-by: GuyAv46 <[email protected]> * Update deps/thpool/thpool.c Co-authored-by: GuyAv46 <[email protected]> --------- Co-authored-by: GuyAv46 <[email protected]> (cherry picked from commit 874ce68)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 8.4 #7519 +/- ##
==========================================
- Coverage 85.87% 85.84% -0.03%
==========================================
Files 330 330
Lines 52465 52520 +55
Branches 12001 12001
==========================================
+ Hits 45055 45087 +32
- Misses 7243 7266 +23
Partials 167 167
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
GuyAv46
approved these changes
Nov 26, 2025
alonre24
approved these changes
Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #7410
Note
Make worker thread reduction asynchronous via new thpool API and update workers management/tests accordingly.
redisearch_thpool_schedule_config_reduce_threads_job(...)using ADMIN jobs + barrier; remove blockingremove_threadsandterminate_when_emptyAPIs.thread_dotake arg struct; signal startup viastartedflags for deterministic init waits; updatethread_init/add_threadsto wait on per-thread start.redisearch_thpool_push_chain,_add_n_work_not_verify_init) and useRS_ASSERT; minor log/strings tweaks.terminate_threadsand stats intact.FT.DEBUG WORKERS DRAINwarning about possible deadlock; comments updated in config setters.Written by Cursor Bugbot for commit dc0ae23. This will update automatically on new commits. Configure here.