Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #931 +/- ##
==========================================
- Coverage 97.01% 96.99% -0.03%
==========================================
Files 129 129
Lines 7574 7576 +2
==========================================
Hits 7348 7348
- Misses 226 228 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ofiryanai
previously approved these changes
Apr 14, 2026
4 tasks
|
Successfully created backport PR for |
|
Successfully created backport PR for |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 15, 2026
…read during SVS training (#932) * MOD-14826 Use try_lock in debugInfo() to avoid blocking main thread during SVS training (#931) * use try lock * fix test (cherry picked from commit d7a5afb) * remove assert --------- Co-authored-by: meiravgri <109056284+meiravgri@users.noreply.github.com> Co-authored-by: meiravgri <meirav.grimberg@redis.com>
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.
TieredSVSIndex::debugInfo()used a blockingstd::lock_guardonupdateJobMutex. SinceupdateSVSIndexWrapperholds that mutex for the entire duration of SVS training (which can take tens of seconds), any call todebugInfo()— including viasvs_label_count()in the Python bindings — would block until training completed.This means that reading debug info (e.g.,
BACKGROUND_INDEXING,INDEX_UPDATE_SCHEDULED) could stall the calling thread for the full training duration, defeating the purpose of non-blocking status queries.Fix
Replace
std::lock_guardwithstd::unique_lockusingstd::try_to_lock:indexUpdateSchedulednormally.indexUpdateScheduled = true, since the mutex being held byupdateSVSIndexWrappermeans an update is actively running.Flow test update
The
search_insertflow test was implicitly relying on the old blocking behavior —svs_label_count()(which callsdebugInfo()) acted as an accidental synchronization point, blocking until background indexing finished. With the fix,debugInfo()returns immediately, so the test could observe intermediate states (e.g., flat buffer not yet drained while SVS already has vectors).Updated the test to remove the per-iteration
assert bf_curr_size < prev_bf_sizecheck and instead assertbf_size == 0afterwait_for_index()completes.Mark if applicable
Note
Low Risk
Low risk: changes only debug/observability behavior and a flow test assertion, without affecting indexing or query logic. Main risk is slightly altered
BACKGROUND_INDEXINGreporting while training is in progress.Overview
Prevents
TieredSVSIndex::debugInfo()from blocking for the full SVS training duration by switching theupdateJobMutexacquisition totry_to_lock; when the mutex is held (training running), it reportsindexUpdateScheduled=trueto keepBACKGROUND_INDEXINGon.Updates
test_search_insertto stop asserting the flat-buffer size monotonically decreases during background indexing, and instead asserts the buffer is fully drained (get_curr_bf_size()==0) afterwait_for_index()completes.Reviewed by Cursor Bugbot for commit d9edf21. Bugbot is set up for automated code reviews on this repo. Configure here.