Skip to content

fix: fix query context precedence layer for datasource-level per-segment timeout#19654

Open
jtuglu1 wants to merge 1 commit into
apache:masterfrom
jtuglu1:fix-per-segment-timeout-injection-layer-precedence
Open

fix: fix query context precedence layer for datasource-level per-segment timeout#19654
jtuglu1 wants to merge 1 commit into
apache:masterfrom
jtuglu1:fix-per-segment-timeout-injection-layer-precedence

Conversation

@jtuglu1

@jtuglu1 jtuglu1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Currently, per-datasource, per-segment timeout can be not set if there's a hardcoded static default query context (druid.query.default.context.perSegmentTimeout). This ensures the evaluation precedence for the per-segment timeout is as follows (from highest to lowest):

  1. Query-specified context values (passed in the query payload)
  2. Dynamic configs (broker per segment timeout, broker dynamic config, etc.). Former beats the latter for this particular config.
  3. Static defaults specified at process boot (druid.query.default.context.perSegmentTimeout)
  4. Default values specified in the application code.

Also adds the perSegmentTimeout context key so it's easy to auto-complete in the UI.

Release note

Fix query context precedence layer for datasource-level per-segment timeout.


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.

@jtuglu1 jtuglu1 force-pushed the fix-per-segment-timeout-injection-layer-precedence branch from 1b93d75 to de098fe Compare July 3, 2026 00:06
@jtuglu1 jtuglu1 changed the title fix: fix query context precedence layer fix: fix query context precedence layer for datasource-level per-segment timeout Jul 3, 2026
@jtuglu1 jtuglu1 force-pushed the fix-per-segment-timeout-injection-layer-precedence branch from de098fe to af877ed Compare July 3, 2026 00:55
@jtuglu1 jtuglu1 added the Bug label Jul 3, 2026
@jtuglu1 jtuglu1 added this to the 38.0.0 milestone Jul 3, 2026
@jtuglu1 jtuglu1 marked this pull request as ready for review July 3, 2026 03:20
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.

1 participant