Skip to content

peer: Limit peer queued output bytes. - #3747

Open
jholdstock wants to merge 1 commit into
decred:masterfrom
jholdstock:slowread-oom-fix
Open

peer: Limit peer queued output bytes.#3747
jholdstock wants to merge 1 commit into
decred:masterfrom
jholdstock:slowread-oom-fix

Conversation

@jholdstock

@jholdstock jholdstock commented Jul 24, 2026

Copy link
Copy Markdown
Member

Track the total serialized bytes currently queued for sending to each peer, and disconnect a peer whose queued bytes exceed maxQueuedOutputBytes (40 MiB). This limit comfortably exceeds the largest single message.

Note for review

The 40 MiB limit added in this PR has been set somewhat arbitrarily and is worth scrutiny.

@davecgh davecgh added this to the 2.2.0 milestone Jul 24, 2026
@jholdstock
jholdstock marked this pull request as draft July 25, 2026 13:42
Track the total serialized bytes currently queued for sending to each
peer, and disconnect a peer whose queued bytes exceed
maxQueuedOutputBytes (40 MiB). This limit comfortably exceeds the
largest single message.
@jholdstock jholdstock changed the title peer: Limit impact of slow reading peers. peer: Limit peer queued output bytes. Aug 4, 2026
@jholdstock
jholdstock marked this pull request as ready for review August 4, 2026 02:59
@jholdstock

Copy link
Copy Markdown
Member Author

I've rebased this and its ready for a review, however I'm not sure if it is still needed or desirable after we have already implemented the read deadline in #3751. I am fairly certain the code in this PR works well, but its feels inelegant and brittle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants