Repository navigation
[Flink][PubsubIO] Make the unbounded source's scale-out and in-flight cap configurable - #41906
Draft
nadberezny wants to merge 1 commit into
Draft
nadberezny wants to merge 1 commit into
nadberezny wants to merge 1 commit into
Conversation
…nfigurable PubsubUnboundedSource hardcodes two read settings that depend on the runner and the client: - SCALE_OUT (4): readers created per split the runner asks for, to hide the latency of blocking unary pulls. With a client that pulls in the background (for example StreamingPull through a custom PubsubClientFactory) the extra readers only add connections. - MAX_IN_FLIGHT (20000): received but unacked messages per reader. Messages are acked when the checkpoint covering them is finalized, so this bounds how far reading runs ahead of checkpointing, and should follow the checkpoint interval and message rate. Add the pipeline options pubsubReadScaleOut and pubsubReadMaxInFlight, with the current values as defaults. Nothing changes unless they are set. Not used on Dataflow, which replaces the source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nadberezny
marked this pull request as draft
December 3, 2026 15:56
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.
PubsubUnboundedSourcehardcodes the readers per split (SCALE_OUT = 4) and the cap on unacked messages per reader (MAX_IN_FLIGHT = 20000).The right values depend on the client and the checkpoint interval. For example, a custom
PubsubClientFactorythat doesn't block on pull gains nothing from extra readers.This adds the
PubsubOptionssettingspubsubReadScaleOutandpubsubReadMaxInFlight. They default to the current values, so nothing changes unless you set them.Tested in
PubsubUnboundedSourceTest.