ft_aggregate: pass explicit TIMEOUT to absorb RediSearch slow scans#2393
Merged
amankrx merged 2 commits intoJun 10, 2026
Conversation
|
@amankrx is attempting to deploy a commit to the native-link-web-assets Team on Vercel. A member of the Team first needs to authorize it. |
a1da964 to
bb27dd5
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
bb27dd5 to
4dc94d1
Compare
palfrey
requested changes
Jun 10, 2026
RediSearch's module default (~500 ms) is far too tight for the scheduler's awaited-action index under any meaningful load: queries time out, NativeLink surfaces them as parse errors, and the dedup lookup fails. When dedup fails the scheduler creates a duplicate operation for an action that is already in flight -- observed as "two same actions running on different PRs" with each running the full maxActionExecutingTimeoutS window before completing. Pass an explicit value generous enough to absorb 1M+ document scans on a busy RediSearch instance. FakeRedisBackend's FT.AGGREGATE handler learns to tolerate the new explicit TIMEOUT clause (skipping it before validating the LOAD args), so the fake keeps working for both the new caller shape and any older one. Test coverage, all in the existing separate test suites. Every FT.AGGREGATE mock in nativelink-store/tests/redis_store_test.rs is updated to expect the new `TIMEOUT 10000` clause the real caller now emits, covering test_search_by_index, test_search_by_index_with_sort_key, test_search_by_index_resp3, test_search_by_index_swallows_already_exists_from_ft_create, test_search_by_index_preserves_other_ft_create_errors, test_search_by_index_skips_int_from_cursor_read, and the error-path log assertion in test_search_by_index_failure. nativelink-scheduler/tests/redis_store_awaited_action_db_test.rs exercises the fake's TIMEOUT-skipping path end to end through the real ft_aggregate caller; it fails without the FakeRedisBackend change.
Co-authored-by: Tom Parker-Shemilt <palfrey@tevp.net>
2a4a72f to
c900c64
Compare
palfrey
approved these changes
Jun 10, 2026
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.
Description
RediSearch's module default (~500 ms) is far too tight for the scheduler's awaited-action index under any meaningful load: queries time out, NativeLink surfaces them as parse errors, and the dedup lookup fails. When dedup fails the scheduler creates a duplicate operation for an action that is already in flight -- observed as "two same actions running on different PRs" with each running the full maxActionExecutingTimeoutS window before completing. Pass an explicit value generous enough to absorb 1M+ document scans on a busy RediSearch instance.
FakeRedisBackend's FT.AGGREGATE handler learns to tolerate the new explicit TIMEOUT clause (skipping it before validating the LOAD args), so the fake keeps working for both the new caller shape and any older one.
Test coverage, all in the existing separate test suites:
nativelink-store/tests/redis_store_test.rs pins the exact FT.AGGREGATE argument list (now including TIMEOUT 10000) in test_search_by_index, test_search_by_index_with_sort_key, test_search_by_index_resp3, test_search_by_index_skips_int_from_cursor_read, and the error-path log assertion in test_search_by_index_failure.
nativelink-scheduler/tests/redis_store_awaited_action_db_test.rs exercises the fake's TIMEOUT-skipping path end to end through the real ft_aggregate caller; it fails without the FakeRedisBackend change.
Fixes # (issue)
Type of change
Please delete options that aren't relevant.
Checklist
bazel test //...passes locallygit amendsee some docsThis change is