Skip to content

ft_aggregate: pass explicit TIMEOUT to absorb RediSearch slow scans#2393

Merged
amankrx merged 2 commits into
TraceMachina:mainfrom
amankrx:ft-aggregate-explicit-timeout
Jun 10, 2026
Merged

ft_aggregate: pass explicit TIMEOUT to absorb RediSearch slow scans#2393
amankrx merged 2 commits into
TraceMachina:mainfrom
amankrx:ft-aggregate-explicit-timeout

Conversation

@amankrx

@amankrx amankrx commented Jun 2, 2026

Copy link
Copy Markdown
Member

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.

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

@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.

@amankrx amankrx force-pushed the ft-aggregate-explicit-timeout branch from a1da964 to bb27dd5 Compare June 8, 2026 20:26
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nativelink Ready Ready Preview, Comment Jun 10, 2026 2:51pm
nativelink-aidm Ready Ready Preview, Comment Jun 10, 2026 2:51pm

Request Review

@palfrey palfrey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny item, otherwise good

Comment thread nativelink-store/src/redis_utils/ft_aggregate.rs Outdated
amankrx and others added 2 commits June 10, 2026 20:20
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>
@amankrx amankrx merged commit 081a2c4 into TraceMachina:main Jun 10, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants