Skip to content

Change default query TIMEOUT to 5000ms and ON_TIMEOUT policy to fail for Flex (disk) indexes - #10395

Merged
raz-mon merged 2 commits into
masterfrom
default-timeout-5000-on-timeout-fail
Jul 8, 2026
Merged

raz-mon merged 2 commits into
masterfrom
default-timeout-5000-on-timeout-fail

Conversation

@raz-mon

@raz-mon raz-mon commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

Describe the changes in the pull request

  1. Current: The default query timeout (TIMEOUT / search-timeout) is 500ms and the default timeout policy (ON_TIMEOUT / search-on-timeout) is return (return partial results on timeout), regardless of whether the deployment uses disk-based (Flex) indexes.
  2. Change: In Flex mode (SearchDisk_IsEnabled(), i.e. bigredis-enabled), where every index is disk-based, the config defaults registered with Redis become TIMEOUT 5000 and ON_TIMEOUT fail. Non-Flex deployments keep the existing 500ms / return defaults. Explicitly configured values (module ARGS, config file, CONFIG SET) still override the defaults as before.
  3. Outcome: Disk-based queries, which are expected to take longer, get more time to complete by default — and when they do time out, users get an explicit error rather than silently-partial results. In-memory deployments are unaffected.

Which additional issues this PR fixes

  1. N/A

Main objects this PR modified

  1. src/config.h: new DEFAULT_QUERY_TIMEOUT_MS_FLEX (5000) and DEFAULT_TIMEOUT_POLICY_FLEX (TimeoutPolicy_Fail) alongside the existing defaults
  2. src/config.c (RegisterModuleConfig_Local): search-timeout and search-on-timeout register Flex-conditional default values (Flex mode is determined before config registration in RedisModule_OnLoad)
  3. tests/cpptests/test_cpp_parse_hybrid.cpp: assert the default timeout via DEFAULT_QUERY_TIMEOUT_MS instead of a hardcoded 500

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

  • This PR requires release notes
  • This PR does not require release notes

If a release note is required (bug fix / new feature / enhancement), describe the user impact of this PR in the title.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size:S label Jul 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2857e430b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config.h Resolved
Comment thread src/config.h Resolved
In Flex mode every index is disk-based, so key the config defaults on
SearchDisk_IsEnabled() at registration time. Non-Flex deployments keep
the existing 500ms / return defaults.

Co-Authored-By: Claude Fable 5 <[email protected]>
@raz-mon raz-mon changed the title Change default query TIMEOUT to 5000ms and default ON_TIMEOUT policy to fail Change default query TIMEOUT to 5000ms and ON_TIMEOUT policy to fail for Flex (disk) indexes Jul 8, 2026
@raz-mon
raz-mon requested a review from ofiryanai July 8, 2026 13:52
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.50%. Comparing base (f4d3f70) to head (0e510a2).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10395      +/-   ##
==========================================
- Coverage   81.51%   81.50%   -0.01%     
==========================================
  Files         558      558              
  Lines       75289    75289              
  Branches    30271    30271              
==========================================
- Hits        61373    61368       -5     
- Misses      13633    13638       +5     
  Partials      283      283              
Flag Coverage Δ
flow 83.45% <ø> (-0.03%) ⬇️
unit 52.02% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raz-mon
raz-mon enabled auto-merge July 8, 2026 14:17
@raz-mon
raz-mon disabled auto-merge July 8, 2026 14:35
@raz-mon
raz-mon merged commit e5acfc2 into master Jul 8, 2026
49 of 51 checks passed
@raz-mon
raz-mon deleted the default-timeout-5000-on-timeout-fail branch July 8, 2026 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants