Repository navigation
fix: reschedule tasks that do not fit in a poll response - #2795
Merged
Merged
Conversation
Under pull scheduling the scheduler binds tasks, marking them running, before tonic encodes the PollWorkResult. When the response exceeds the gRPC encoding limit (many tasks with large plans, such as broadcast readers listing every upstream location at 128 partitions) the executor gets an error, the tasks are never run, and the job hangs. Send only the tasks that fit and report the rest as killed, which re-queues their partitions without counting a failure. A single task larger than the limit fails its job with an error naming the setting to raise.
andygrove
force-pushed
the
fix-poll-response-size
branch
from
November 7, 2026 17:26
e754faa to
09f0ad7
Compare
milenkovicm
approved these changes
Nov 7, 2026
milenkovicm
left a comment
Contributor
There was a problem hiding this comment.
Thanks @andygrove, I have observed this issue few times, good fix. Making jobs fail instead of hanging is a good fix
Ballista plan is encoding a bit too much information which #1851 outlines, we should try to find a way to reduce it
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.
Which issue does this PR close?
No single issue. Split out of #2792. Related: #2520 (performance review tracking).
Rationale for this change
Under pull scheduling the scheduler binds tasks, marking them running, before tonic encodes the
PollWorkResult. When the response exceeds the gRPC encoding limit (many tasks with large plans, such as broadcast readers listing every upstream location at 128 partitions), the executor gets an error, the tasks never run, and the job hangs.What changes are included in this PR?
The scheduler's poll handler keeps the tasks that fit under the gRPC encoding limit (
--grpc-server-max-encoding-message-size), counting the cleanup list in the same response, and returns the rest to their stages. A task that does not fit does not stop smaller ones behind it from being kept.FailedTask::from(BallistaError::Cancelled), the retryableTaskKilledstatus executors send for a cancelled task. The stage re-queues their partitions, and the tasks are bound again on a later poll.Unit tests check the size estimate against prost's real encoding (a limit of exactly three tasks plus a cleanup entry keeps three, one byte less keeps two) and that small tasks behind an oversized one are kept.
Known limits:
TaskKilledpaths. The counter is also the attempt number used in shuffle file names, so it must keep increasing. It is compared withmax_task_failuresonly when a task fails withcount_to_failures.fit_tasks_in_responseitself has no unit test, since it needs a running job; the splitting is tested.Are there any user-facing changes?
No config or API changes. A job that previously hung now runs, or fails with an error that names the gRPC message-size setting.