Skip to content

Apply gRPC flow control to binary store uploads #1923

Backlog

Description

@yangding14

Describe the feature

DaprPreviewClient.setBinaryFile reads the whole content Flux at once and passes every chunk to gRPC without checking isReady(). If the content is produced faster than the network sends it, gRPC holds the rest in memory. The Javadoc states this as a known limit, and so does #1870.

getBinaryFile already avoids this for downloads: it asks gRPC for a message only when the subscriber has demand. Upload should do the same in the other direction:

  • Register setOnReadyHandler in ClientResponseObserver.beforeStart.
  • Request one content chunk at a time, and only while isReady() is true.
  • Use prefetch 1 in the step that splits content into 32 KiB chunks.

No public API change.

#1870 says crypto encrypt has the same limit; it could follow the same approach.

Release Note

RELEASE NOTE: UPDATE setBinaryFile applies gRPC flow control to uploads.

Activity

  1. yangding14 commented on Nov 30, 2026

    @yangding14
    Author

    I would like to work on this. Proposed approach, for a maintainer to confirm before I open a pull request:

    • In DaprBinaryFileClient.setBinaryFile, pass a ClientResponseObserver and register setOnReadyHandler in beforeStart.
    • Replace the anonymous content subscriber with a small private subscriber class that requests one chunk at a time, and only while isReady() is true. It asks again after each chunk is sent and each time gRPC becomes ready.
    • Pass prefetch 1 to concatMapIterable, so at most one content chunk waits to be split.
    • Update the setBinaryFile Javadoc in DaprPreviewClient, and add a unit test next to getBinaryFileBackpressureTest.

    No public API change. Crypto encrypt is left out of this change.

    If this looks right, could a maintainer assign the issue to me?

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