Skip to content

[Feature Request]: Make PubsubUnboundedSource SCALE_OUT and MAX_IN_FLIGHT configurable #41940

Todo

Description

@nadberezny

PubsubUnboundedSource hardcodes two read settings:

  • SCALE_OUT = 4: the number of readers created for each split the runner asks for, to hide the latency of blocking pulls.
  • MAX_IN_FLIGHT = 20000: the most received but unacked messages one reader holds. Messages are acked when the checkpoint covering them is finalized.

The right values depend on the client and the checkpoint interval, and they can't be changed today. For example, a custom PubsubClientFactory that doesn't block on pull gains nothing from extra readers, and the in-flight cap should follow the checkpoint interval and message rate.

Proposal: add two PubsubOptions settings, pubsubReadScaleOut and pubsubReadMaxInFlight, with the current values as defaults so nothing changes unless they are set. They affect runners that run the Beam source, such as Flink, Spark and Direct; Dataflow replaces the source with its own Pub/Sub read.

Activity

  1. sakshammalik260-cse commented on Dec 4, 2026

    @sakshammalik260-cse
    Contributor

    .take-issue

  2. sakshammalik260-cse commented on Dec 4, 2026

    @sakshammalik260-cse
    Contributor

    Hi @nadberezny,

    I'd like to investigate implementing this feature.

    Would you prefer the new options to be validated as strictly positive values, with the existing defaults retained when unset?

    I'll first inspect the source and runner-specific behaviour to ensure the configuration is applied consistently.

  3. sakshammalik260-cse commented on Dec 5, 2026

    @sakshammalik260-cse
    Contributor

    .free-issue

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions