Skip to content

fix: ensure query timeout is respected at router#19402

Draft
jtuglu1 wants to merge 1 commit intoapache:masterfrom
jtuglu1:fix-query-timeout-bug
Draft

fix: ensure query timeout is respected at router#19402
jtuglu1 wants to merge 1 commit intoapache:masterfrom
jtuglu1:fix-query-timeout-bug

Conversation

@jtuglu1
Copy link
Copy Markdown
Contributor

@jtuglu1 jtuglu1 commented May 4, 2026

Description

We have seen queries fail to reach upstream brokers for a variety of reasons (lack of available broker connections, DNS issues, etc.). In these cases, the router does not fall-back to a sensible timeout (defaulting to the 15mins connection timeout). Since the router is part of Druid, we should be treating the maximum timeout as the min(query timeout, configured router<-->broker connection timeout) to avoid pathological cases where users expect a result in ≤ {query timeout} but end up receiving it 15mins later (or whatever druid.router.http.readTimeout is set to).

Other databases separate timeouts into connection vs read timeouts, the former being a timeout on the time taken for the client to establish a connection to the server whereas the latter is a bound on the time taken to perform the actual query. This ensures Druid properly sets read timeout to be the minimum of druid.router.http.readTimeout and user-specified/cluster-configured default query timeout.

Release note


Key changed/added classes in this PR
  • MyFoo
  • OurBar
  • TheirBaz

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

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.

1 participant