Skip to content

Add better "flow control" support to Grizzly FeedableBodyGenerator. #368

@rlubke

Description

@rlubke

Currently, Grizzly's FeedableBodyGenerator will write data as fast as it is provided, however, if the remote peer isn't consuming the data as fast as it is being written, the async write queue will fill and could lead to an OOM depending on the VM configuration.

The implementation should be leveraging Connection.canWrite() and Connection.notifyCanWrite(WriteListener).

After each chunk is written, the implementation should call Connection.canWrite() to see if the async write queue length has been exceeded. If it has, then we can block the caller until pressure on the queue has been relieved.

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