Skip to content

poll_read data is buffered without bounds #308

Open
@jvimal

Description

@jvimal

buf: BufList::new(),

The poll_read() on BufRecvStream (wrapping the underlying QUIC provider's stream) is buffering chunks in-memory in a BufList that appears to grows without bounds:

h3/h3/src/stream.rs

Lines 448 to 450 in 84316da

if let Some(mut data) = data {
self.buf.push_bytes(&mut data);
Poll::Ready(Ok(false))

In some tests that I ran over loopback to send and receive data as fast as possible, if the client does not consume from BufRecvStream quickly (for any reason) I observed that the client memory grows without bounds. This should ideally not be the case -- a slow consumer should back-pressure the sender. This problem does not exist if I use the underlying QUIC provider's stream directly.

I don't have a handy reproducer that I can share at the moment, but I can work on one if it'll be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-rfcBlocked: request for comments. Needs more discussion.C-bugCategory: bug. Something is wrong. This is bad!C-refactorCategory: refactor. This would improve the clarity of internal code.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions