[SPARK-49580][CONNECT] Add config to limit concurrent executions#56926
Draft
psavalle wants to merge 1 commit into
Draft
[SPARK-49580][CONNECT] Add config to limit concurrent executions#56926psavalle wants to merge 1 commit into
psavalle wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whenspark.connect.execute.maxConcurrentQueriesis 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)