Skip to content

[SPARK-49580][CONNECT] Add config to limit concurrent executions#56926

Draft
psavalle wants to merge 1 commit into
apache:masterfrom
psavalle:pa/connect-num-sessions
Draft

[SPARK-49580][CONNECT] Add config to limit concurrent executions#56926
psavalle wants to merge 1 commit into
apache:masterfrom
psavalle:pa/connect-num-sessions

Conversation

@psavalle

@psavalle psavalle commented Jul 1, 2026

Copy link
Copy Markdown

What changes were proposed in this pull request?

This is a first attempt at SPARK-49580, adding a maximum number of concurrent executions.

Why are the changes needed?

With Spark Connect, it is more common to have many users running possibly many queries concurrently against a single driver, and it would be useful to have some control over the maximum number of executions that can occur.

Does this PR introduce any user-facing change?

Yes, new configuration parameters:

  • spark.connect.execute.maxConcurrentQueries: maximum number of concurrent queries that can be executed. When this limit is reached, new queries will wait in a queue until a slot becomes available. Set to 0 or negative to disable the limit (unlimited concurrency). This only affects Spark Connect executions.

  • spark.connect.execute.maxConcurrentQueries.timeout: aximum time a query waits for an execution slot when spark.connect.execute.maxConcurrentQueries is reached. Waiters are served in FIFO order. If a slot does not become available within this time, the query fails with a retryable error so the client re-submits it. Set to 0 to wait indefinitely.

Note: maybe 'maxConcurrentExecutions' would be more precise here? Not sure what the best naming would be.

How was this patch tested?

Added tests, will do more testing once we confirm the plan makes sense.

Was this patch authored or co-authored using generative AI tooling?

Yes, modified changes provided by Claude.

Generated-by: 2.1.159 (Claude Code)

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