-
Notifications
You must be signed in to change notification settings - Fork 32
[8.4] SVS shared thread pool with rental model (MOD-9881, MOD-17090) #1003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7102be2
refactor: SVS shared thread pool with rental model (MOD-9881) (#925)
meiravgri bbaa34a
MOD-15578 Track shared SVS thread pool memory & expose it through pub…
dor-forer 947a37b
MOD-15579 Lazy initialization of the shared SVS thread pool (#971)
dor-forer 0b975a1
MOD-15579 Report 0 shared SVS memory until first index attaches (#979)
dor-forer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Task exception permanently leaks pending_jobs counter
Medium Severity
If
jobPtr->task()throws inExecuteMultiThreadJobImpl,delete_job(job)is never reached, so the~SVSMultiThreadJobdestructor never runs andendScheduledJob()is never called. This permanently incrementspending_jobs_, causing all future pool shrink requests to be deferred indefinitely and never applied. TheisScheduled/endScheduledJob()mechanism is new in this PR, introducing this failure mode where the deferred-resize protocol becomes permanently stuck.Additional Locations (1)
src/VecSim/algorithms/svs/svs_tiered.h#L171-L176Reviewed by Cursor Bugbot for commit 0b975a1. Configure here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed — real bug, and worse than described:
ExecuteMultiThreadJobImplis invoked from RediSearch's plain-C pthread worker pool (no C++ handler anywhere on that call stack), so an uncaught exception here callsstd::terminate()— a process crash, not just a stuckpending_jobs_counter.task()realistically can throw:updateSVSIndexWrapper/SVSIndexGCWrapper→updateSVSIndex()→createImpl/setImpl, which already contain explicitthrow std::logic_error(...)(non-emptyimpl_, faileddynamic_cast) plus ordinarybad_allocrisk.Important: this isn't introduced by this backport.
isScheduled/endScheduledJob()are verbatim from #925, already merged and live onmain,8.6, and8.6-rse. Bugbot flags it as new only because it's diffing against 8.4's pre-#925 baseline.Not fixing this in the backport PR — patching only here would diverge from upstream and this needs a real fix (wrap the
task()call, decide failure semantics) onmainfirst, then flow down through the other branches like everything else. Tracking separately.