Skip to content

[FEATURE] Per-request timeouts #4886

Open

Description

@Swiddis

Is your feature request related to a problem?
#4857 introduces a global timeout setting for all Calcite PPL queries. This helps address the major concern from #4842 on overwhelming a cluster with hour-long query times in some types of slow loops. But the global setting isn't generally applicable to every query: some specific queries may want to go longer, others may want to go shorter.

What solution would you like?
In addition to the global timeout setting from #4857, also support a per-request timeout.

$ curl -XPOST ... --data '{
  "query": "...",
  "timeout": 60
}'

This would set a timeout of 60 seconds, regardless of the global cluster setting.

A zero or negative timeout would mean no timeout.

What alternatives have you considered?
Just stick with the global timeout option. Works well enough for managed clusters, but is an issue with Serverless.

Do you have any additional context?
N/A

Activity

  1. added
    enhancement
    on Dec 1, 2025
  2. Hailong-am commented on Oct 16, 2026

    @Hailong-am
    Contributor

    +1 on the per-request timeout. We hit exactly this gap in opensearch-mcp-server-py: the MCP server exposes a PPLQueryTool, and we wanted to bound each tool-driven PPL query the same way we do for DSL searches (where _search accepts cancel_after_time_interval). The global plugins.ppl.query.timeout from #4857 doesn't cover this — an MCP/agent caller can't retune cluster settings per query, and on Serverless it's not tunable at all, so today the only bound is the client-side HTTP connection timeout.

    A body-level timeout would let an agent set a short budget on an exploratory query and a longer one on a known-heavy aggregation, without touching cluster state. The 0/negative = no timeout convention works well for us too.

    Would be great to see this prioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions