Skip to content

[MOD-14073] Coordinator-level FAIL timeout for FT.HYBRID - #8420

Merged
lerman25 merged 14 commits into
masterfrom
omerl-hybrid-coord-fail
Feb 26, 2026
Merged

lerman25 merged 14 commits into
masterfrom
omerl-hybrid-coord-fail

Conversation

@lerman25

@lerman25 lerman25 commented Feb 18, 2026 •

Copy link
Copy Markdown
Collaborator

Title: [Hybrid] Coordinator handle fail timeout policy

Description:

Implements the fail timeout policy for FT.HYBRID at the coordinator level, ensuring that when a timeout occurs, the command returns an error immediately and discards any partial results.

Background

The fail timeout policy requires special handling at the coordinator level because:

  1. The Redis blocking client timeout callback runs on the main thread
  2. The query execution runs on a background thread (coordinator thread pool)
  3. Both threads may try to reply to the client simultaneously, causing race conditions

Implementation

This PR introduces CoordRequestCtx - a coordinator-level request context that wraps HybridRequest and provides synchronization primitives for timeout handling:

Key Components:

  • CoordRequestCtx struct (coord_request_ctx.h/c): Wrapper that holds a pointer to the actual request with timeout coordination fields
  • setReqLock mutex: Protects the critical window between request creation and registration
  • timedOut atomic flag: Signals timeout to the background thread
  • Reply state machine: NOT_REPLIED → REPLYING → REPLIED transitions using CAS operations to ensure only one thread replies

Synchronization Protocol:

  1. Before request creation (background thread holds lock):

    • If timeout fires: timeout callback sets timedOut flag, replies with error
    • Background thread checks flag after acquiring lock, aborts if set
  2. After request creation (lock released):

    • Both threads race to claim reply ownership via TryClaimReply()
    • Winner replies, loser either aborts (background) or waits (timeout callback)

Timeout Callback (DistHybridTimeoutFailClient):

Lock → SetTimedOut → Check HasRequest → 
  If no request: reply with timeout error, unlock
  If request exists: unlock → TryClaimReply → reply if claimed, else wait

Background Thread (RSExecDistHybrid):

Lock → Check TimedOut → 
  If timed out: unlock, return (timeout callback handles reply)
  Else: create request, set request, unlock → execute → TryClaimReply → reply

Related PRs


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.


Note

Medium Risk
Touches coordinator blocked-client timeout callbacks and cross-thread reply/ownership coordination for FT.HYBRID, where subtle races could cause double replies or leaks. Scope is mostly limited to hybrid/coordinator execution and is covered by expanded timeout tests.

Overview
FT.HYBRID on clustered deployments now honors ON_TIMEOUT fail at the coordinator: when the client-side timeout triggers, the command returns a timeout error immediately and avoids emitting partial results.

This adds a coordinator request wrapper (CoordRequestCtx) plus shared sync primitives (RequestSyncCtx) to coordinate timeout signaling, reply ownership, and lifetime between the main-thread timeout callback and the coordinator worker thread. The concurrent execution wrapper is extended to pass blocked-client timeout callbacks/privdata, and tests are expanded to cover hybrid timeout before pickup, after fanout, and in FT.PROFILE hybrid flows.

Written by Cursor Bugbot for commit e632fa0. This will update automatically on new commits. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements coordinator-level FAIL timeout policy for FT.HYBRID commands to provide consistent timeout handling across the distributed search architecture. The implementation mirrors the existing AREQ timeout pattern by introducing reference counting and reply state management for HybridRequest objects.

Changes:

  • Adds CoordRequestCtx wrapper for managing shared ownership of requests between timeout callbacks (main thread) and execution handlers (background thread)
  • Extends HybridRequest with atomic timeout and reply state fields plus reference counting (mirroring AREQ)
  • Exposes AREQ reply state management functions (TryClaimReply, MarkReplied, GetReplyState) as public API for reuse with HybridRequest
  • Updates all test code to use HybridRequest_DecrRef instead of direct HybridRequest_Free

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/hybrid/hybrid_request.h Adds timeout fields (timedOut, replyState, refcount) and new API functions for reference counting and reply state management
src/hybrid/hybrid_request.c Implements HybridRequest_Init, IncrRef/DecrRef, timeout helpers, and reply state functions
src/hybrid/hybrid_exec.c Adds timeout checks before and after pipeline execution in sendChunk_hybrid
src/hybrid/hybrid_debug.c Updates to use HybridRequest_DecrRef
src/coord/coord_request_ctx.h New file defining CoordRequestCtx wrapper for unified AREQ/HybridRequest timeout handling
src/coord/coord_request_ctx.c Implements CoordRequestCtx creation, freeing, and forwarding to underlying request functions
src/coord/hybrid/dist_hybrid.h Declares DistHybridTimeoutFailClient callback
src/coord/hybrid/dist_hybrid.c Implements timeout callback and updates cleanup paths to handle reply ownership coordination
src/module.c Integrates timeout handling in DistHybridCommand with CoordRequestCtx creation and callback registration
src/concurrent_ctx.h Adds ConcurrentSearchBlockClientCtx struct and reqCtx field to ConcurrentSearchHandlerCtx
src/concurrent_ctx.c Updates to use blocking client context configuration and adds GetBlockedClient accessor
src/aggregate/aggregate.h Exposes reply state management functions as public API
src/aggregate/aggregate_request.c Implements public TryClaimReply, MarkReplied, GetReplyState functions
src/aggregate/aggregate_exec.c Removes static versions of reply state functions (now public)
tests/cpptests/*.cpp All test files updated to use HybridRequest_DecrRef instead of HybridRequest_Free

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/concurrent_ctx.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (3)

src/module.c:84

  • Duplicate include directive. The header "coord/coord_request_ctx.h" is already included at line 75.
#include "coord/coord_request_ctx.h"

src/coord/hybrid/dist_hybrid.c:875

  • Extra blank line. This should be removed for consistency with the rest of the codebase.
    src/coord/hybrid/dist_hybrid.c:868
  • Missing space after 'if' keyword. The codebase consistently uses 'if (' rather than 'if('. Please add a space before the opening parenthesis for consistency.
  if(!CoordRequestCtx_HasRequest(CoordReqCtx)) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (3)

src/concurrent_ctx.h:71

  • ConcurrentSearchHandlerCtx_Init uses memset, but concurrent_ctx.h does not include <string.h>. Any translation unit that includes this header without already including <string.h> will get an implicit declaration / compile error for memset (depending on flags). Add #include <string.h> (or equivalent) in this header.
// Initialize a ConcurrentSearchHandlerCtx to zero
static inline void ConcurrentSearchHandlerCtx_Init(ConcurrentSearchHandlerCtx *ctx) {
  memset(ctx, 0, sizeof(*ctx));
}

src/module.c:84

  • coord_request_ctx.h is included twice in this file. While #pragma once prevents duplicate definitions, the second include is redundant and should be removed to keep includes tidy and avoid confusion during future merges.
#include "hybrid/hybrid_exec.h"
#include "coord/coord_request_ctx.h"
#include "coord/hybrid/dist_hybrid.h"
#include "util/redis_mem_info.h"
#include "notifications.h"
#include "aggregate/reply_empty.h"
#include "module_init.h"
#include "asm_state_machine.h"
#include "search_disk_utils.h"
#include "config.h"
#include "coord/coord_request_ctx.h"

src/hybrid/hybrid_request.h:17

  • hybrid_request.h redefines RS_Atomic after including aggregate.h. In C builds, aggregate.h already defines RS_Atomic and does not #undef it, so this is a macro redefinition that can produce warnings (and potentially fail with -Werror). Add #undef RS_Atomic before redefining, or only redefine it in the __cplusplus case where aggregate.h undefs it.
// Re-define RS_Atomic macro for use in HybridRequest struct.
// aggregate.h undefs RS_Atomic at the end, so we need to define it again here.
#ifdef __cplusplus
#include <atomic>
#define RS_Atomic(T) std::atomic<T>
#else
#include <stdatomic.h>
#define RS_Atomic(T) _Atomic(T)
#endif

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/hybrid/hybrid_exec.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/coord/coord_request_ctx.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (3)

src/coord/hybrid/dist_hybrid.c:785

  • DistHybridCleanups only calls RedisModule_EndReply(reply) when it successfully claims reply ownership. In the other branch it jumps to cleanup: and never ends the reply object, which can leak reply resources for timeout-owned cases and for early-error paths. RedisModule_EndReply(reply) should be called exactly once regardless of who owns the client reply (it’s separate from writing to the client).
    QueryError_ReplyAndClear(ctx, status);
    RedisModule_EndReply(reply);
    CoordRequestCtx_MarkReplied(reqCtx);

cleanup:
    WeakRef_Release(ConcurrentCmdCtx_GetWeakRef(cmdCtx));
    if (sp) {
      IndexSpecRef_Release(*strong_ref);
    }
    if (hreq) {
        HybridRequest_DecrRef(hreq);
    }
}

src/module.c:85

  • src/module.c includes coord/coord_request_ctx.h twice. It’s harmless with #pragma once but adds noise and can slow compiles; drop the duplicate include.
#include "coord/coord_request_ctx.h"
#include "coord/hybrid/dist_hybrid.h"
#include "util/redis_mem_info.h"
#include "notifications.h"
#include "aggregate/reply_empty.h"
#include "module_init.h"
#include "asm_state_machine.h"
#include "search_disk_utils.h"
#include "config.h"
#include "coord/coord_request_ctx.h"
#ifdef ENABLE_ASSERT

src/hybrid/hybrid_request.h:17

  • hybrid_request.h redefines RS_Atomic but never #undefs it, unlike aggregate.h which explicitly undefines it to avoid leaking the macro to downstream includes. This can cause surprising macro capture in unrelated headers included after hybrid_request.h. Consider mirroring the aggregate.h pattern: define RS_Atomic locally for this header and #undef RS_Atomic before the final #endif/extern "C" close.
// Re-define RS_Atomic macro for use in HybridRequest struct.
// aggregate.h undefs RS_Atomic at the end, so we need to define it again here.
#ifdef __cplusplus
#include <atomic>
#define RS_Atomic(T) std::atomic<T>
#else
#include <stdatomic.h>
#define RS_Atomic(T) _Atomic(T)
#endif

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/concurrent_ctx.h Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

src/concurrent_ctx.h:71

  • ConcurrentSearchHandlerCtx_Init uses memset but concurrent_ctx.h does not include <string.h>. This can cause implicit declaration / compile failures depending on include order. Include <string.h> (or provide a dedicated zero-init via compound literal) in the header where memset is used.
// Initialize a ConcurrentSearchHandlerCtx to zero
static inline void ConcurrentSearchHandlerCtx_Init(ConcurrentSearchHandlerCtx *ctx) {
  memset(ctx, 0, sizeof(*ctx));
}

src/module.c:84

  • src/module.c includes coord/coord_request_ctx.h twice (lines 75 and 84). Remove the duplicate include to avoid redundant compilation and keep the include list tidy.
#include "hybrid/hybrid_exec.h"
#include "coord/coord_request_ctx.h"
#include "coord/hybrid/dist_hybrid.h"
#include "util/redis_mem_info.h"
#include "notifications.h"
#include "aggregate/reply_empty.h"
#include "module_init.h"
#include "asm_state_machine.h"
#include "search_disk_utils.h"
#include "config.h"
#include "coord/coord_request_ctx.h"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/coord/hybrid/dist_hybrid.c Resolved
Comment thread src/module.c
Comment on lines +3689 to +3706
CoordRequestCtx *reqCtx = CoordRequestCtx_New(COMMAND_HYBRID);


ConcurrentSearchHandlerCtx handlerCtx;
ConcurrentSearchHandlerCtx_Init(&handlerCtx);

handlerCtx.coordStartTime = coordInitialTime;
handlerCtx.spec_ref = StrongRef_Demote(spec_ref);
handlerCtx.numShards = NumShards; // Capture NumShards from main thread for thread-safe access
handlerCtx.reqCtx = reqCtx;

handlerCtx.bcCtx.privdata = reqCtx;
handlerCtx.bcCtx.free_privdata = DistHybridFreePrivData;

if (RSGlobalConfig.requestConfigParams.timeoutPolicy == TimeoutPolicy_Fail) {
handlerCtx.bcCtx.callback = DistHybridTimeoutFailClient;
handlerCtx.bcCtx.timeoutMS = queryTimeoutMS;
}

Copilot AI Feb 19, 2026

Copy link

Choose a reason for hiding this comment

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

reqCtx is stored as blocked-client private data and freed via bcCtx.free_privdata, but the background thread also dereferences it in RSExecDistHybrid (locks it, checks timedOut, sets request, etc.). In Redis modules the block-client free callback can run after the timeout callback, while the background thread may still be executing, which can lead to use-after-free of CoordRequestCtx. Consider adding reference counting to CoordRequestCtx itself (background thread holds a ref; free_privdata just DecrRef), or otherwise guarantee the context isn't freed until the worker finishes.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Blocked Client private data is not freed until the free private data callback is called,
No matter the case, the free callback is not called until the background thread calls unblockClient

@lerman25 lerman25 changed the title [MOD-14073] Coordinator-level FAIL timeout for FT.HYBRID[ [MOD-14073] Coordinator-level FAIL timeout for FT.HYBRID Feb 19, 2026
@lerman25
lerman25 force-pushed the omerl-hybrid-coord-fail branch from afbe486 to 4a026cc Compare February 20, 2026 12:58
@lerman25
lerman25 marked this pull request as ready for review February 20, 2026 12:58
@lerman25
lerman25 requested a review from Copilot February 20, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

src/hybrid/hybrid_request.h:17

  • hybrid_request.h redefines RS_Atomic but never #undefs it in C++ mode, unlike aggregate.h which explicitly undefines RS_Atomic before closing extern "C". This leaks the macro into includers and can cause unexpected macro redefinition/conflicts depending on include order. Consider adding an #undef RS_Atomic at the end of this header (for __cplusplus) to match the pattern in aggregate.h.
// Re-define RS_Atomic macro for use in HybridRequest struct.
// aggregate.h undefs RS_Atomic at the end, so we need to define it again here.
#ifdef __cplusplus
#include <atomic>
#define RS_Atomic(T) std::atomic<T>
#else
#include <stdatomic.h>
#define RS_Atomic(T) _Atomic(T)
#endif

src/module.c:85

  • coord/coord_request_ctx.h is included twice in this file. It’s harmless due to include guards/#pragma once, but should be removed to avoid redundant includes and keep the include list clean.
#include "hybrid/hybrid_exec.h"
#include "coord/coord_request_ctx.h"
#include "coord/hybrid/dist_hybrid.h"
#include "util/redis_mem_info.h"
#include "notifications.h"
#include "aggregate/reply_empty.h"
#include "module_init.h"
#include "asm_state_machine.h"
#include "search_disk_utils.h"
#include "config.h"
#include "coord/coord_request_ctx.h"
#ifdef ENABLE_ASSERT

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/coord/hybrid/dist_hybrid.c Resolved
@nafraf
nafraf self-requested a review February 23, 2026 18:21
Comment thread src/coord/coord_request_ctx.c Resolved
Comment thread src/coord/coord_request_ctx.h Resolved
Comment thread src/hybrid/hybrid_request.h Resolved
}

static inline void HybridRequest_SetSkipTimeoutChecks(HybridRequest *req, bool skipTimeoutChecks) {
req->skipTimeoutChecks = skipTimeoutChecks;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we propagate skipTimeoutChecks to sctx and AREQ subqueries?

@jit-ci

jit-ci Bot commented Feb 24, 2026 •

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

*/
typedef struct CoordRequestCtx {
CommandType type;
union {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Now that we have RequestSyncCtx, can't we replace the union with the new RequestSyncCtx?
This could simplify also the implementation of CoordRequestCtx_TryClaimReply, CoordRequestCtx_MarkReplied, etc.

Comment thread src/coord/hybrid/dist_hybrid.c Outdated

// Create and set request atomically while holding lock
HybridRequest *hreq = MakeDefaultHybridRequest(sctx);
CoordRequestCtx_SetSyncCtx(reqCtx, &hreq->syncCtx);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use-after-free: missing IncrRef for shared syncCtx pointer

High Severity

CoordRequestCtx_SetSyncCtx stores a raw pointer to the HybridRequest's embedded syncCtx, but the HybridRequest refcount (initialized to 1) is never incremented for the timeout callback's access. The background thread calls HybridRequest_DecrRef after sendChunk_hybrid returns, freeing the request. If the timeout callback (DistHybridTimeoutFailClient) wins TryClaimReply and then calls CoordRequestCtx_MarkReplied, it dereferences the now-freed syncCtx pointer — a use-after-free. The analogous FT.SEARCH path correctly calls AREQ_IncrRef in BlockQueryClientWithTimeout to share ownership, but HybridRequest_IncrRef is never called here.

Additional Locations (1)

Fix in Cursor Fix in Web

Comment thread src/aggregate/aggregate_exec.c Outdated
// Assert that timeout only occurs when skipTimeoutChecks is false (if not in debug)
RS_ASSERT(!(rc == RS_RESULT_TIMEDOUT) || !req->skipTimeoutChecks || IsDebug(req));
// Assert that timeout only occurs when skipTimeoutChecks is true (if not in debug)
RS_ASSERT(!(rc == RS_RESULT_TIMEDOUT) || !AREQ_ShouldCheckTimeout(req) || IsDebug(req));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inverted assertion condition for timeout check

Medium Severity

The assertion !AREQ_ShouldCheckTimeout(req) evaluates to req->skipTimeoutChecks, which is the opposite of the original !req->skipTimeoutChecks. The old assert correctly required that RS_RESULT_TIMEDOUT only occurs when timeout checks are enabled (skip is false). The new assert incorrectly requires that RS_RESULT_TIMEDOUT only occurs when timeout checks are disabled. The negation of AREQ_ShouldCheckTimeout needs to be removed.

Additional Locations (1)

Fix in Cursor Fix in Web

@lerman25
lerman25 force-pushed the omerl-hybrid-coord-fail branch from fc4841c to 608fe46 Compare February 26, 2026 18:23
@lerman25
lerman25 requested a review from nafraf February 26, 2026 18:23
Comment thread src/coord/hybrid/dist_hybrid.c Outdated
// No error - just cleanup
// This can happen if during request creation we realized the query timed out, and the timeout callback already replied.
goto cleanup;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing MarkReplied causes potential main-thread deadlock

Medium Severity

When hreq is non-NULL and CoordRequestCtx_TryClaimReply succeeds but QueryError_HasError(status) returns false, the code jumps to cleanup without calling CoordRequestCtx_MarkReplied. This leaves the reply state stuck at ReplyState_Replying. If the timeout callback then fires, its TryClaimReply CAS fails (state is Replying, not NotReplied), and the busy-wait loop in DistHybridTimeoutFailClient spins forever since the state never transitions to Replied — deadlocking the Redis main thread.

Additional Locations (1)

Fix in Cursor Fix in Web

Comment thread src/concurrent_ctx.h Outdated
WeakRef spec_ref; // Weak reference to the index spec
bool isProfile; // Whether this is an FT.PROFILE command
size_t numShards; // Number of shards in the cluster (captured from main thread)
struct CoordRequestCtx *reqCtx; // Coordinator request context (for timeout handling)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused reqCtx field is dead code

Low Severity

The reqCtx field in ConcurrentSearchHandlerCtx is written to in DistHybridCommand but never read anywhere in the codebase. The CoordRequestCtx is actually accessed through the blocked client's private data (RedisModule_BlockClientGetPrivateData), making this field and its assignment entirely dead code.

Additional Locations (1)

Fix in Cursor Fix in Web

nafraf
nafraf previously approved these changes Feb 26, 2026
@lerman25
lerman25 added this pull request to the merge queue Feb 26, 2026
@lerman25
lerman25 removed this pull request from the merge queue due to a manual request Feb 26, 2026
@sonarqubecloud

Copy link
Copy Markdown

@lerman25
lerman25 enabled auto-merge February 26, 2026 21:59

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

// We should check for timeout in pipeline if policy is return and timeout > 0
return req->reqConfig.queryTimeoutMS > 0 &&
(req->reqConfig.timeoutPolicy == TimeoutPolicy_Return);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ReturnStrict timeout disabled without alternative mechanism

Medium Severity

shouldCheckInPipelineTimeoutCoord only enables pipeline timeout checks for TimeoutPolicy_Return, excluding TimeoutPolicy_ReturnStrict. Meanwhile, DistHybridCommand only sets up a blocked client timeout callback for TimeoutPolicy_Fail. Before this PR, all policies had clock-based pipeline checks (via default skipTimeoutChecks = false). Now ReturnStrict has neither pipeline checks nor a blocked client timeout, so FT.HYBRID queries on the coordinator will never time out under this policy. Compare with DistSearchBlockClientWithTimeout, which handles both Fail and ReturnStrict.

Additional Locations (1)

Fix in Cursor Fix in Web

@lerman25
lerman25 added this pull request to the merge queue Feb 26, 2026
Merged via the queue into master with commit 8e14a92 Feb 26, 2026
47 checks passed
@lerman25
lerman25 deleted the omerl-hybrid-coord-fail branch February 26, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants