Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

feat: limit internal message buffer size #174

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jun 11, 2022

Adds a new config option maxStreamBufferSize which controls how large the input message buffer for a multiplexed stream is allowed to grow - defaults to 4MB similar to go-mplex.

If a stream handler does not process messages fast enough and the input buffer reaches this size, the stream will be reset and an error thrown to the handler.

See option 2 in the spec implementation notes.

Adds a new config option `maxStreamBufferSize` which controls how
large the input message buffer for a multiplexed stream is allowed to
grow - defaults to 4MB [similar to go-mplex](https://github.com/libp2p/go-mplex/blob/master/multiplex.go#L26).

If a stream handler does not process messages fast enough and the input
buffer reaches this size, the stream will be reset and an error thrown
to the handler.

See option 2 in the [spec implementation notes](https://github.com/libp2p/specs/blob/master/mplex/README.md#implementation-notes).
@achingbrain achingbrain force-pushed the feat/limit-internal-message-buffer-size branch from 50c8ebe to d34c2d1 Compare June 11, 2022 08:14
@paralin
Copy link
Contributor

paralin commented Jun 13, 2022

👍🏽

@mpetrunic mpetrunic merged commit 0c8e1b0 into master Jun 13, 2022
@mpetrunic mpetrunic deleted the feat/limit-internal-message-buffer-size branch June 13, 2022 09:18
github-actions bot pushed a commit that referenced this pull request Jun 13, 2022
## [1.2.0](v1.1.2...v1.2.0) (2022-06-13)

### Features

* limit internal message buffer size ([#174](#174)) ([0c8e1b0](0c8e1b0)), closes [/github.com/libp2p/go-mplex/blob/master/multiplex.go#L26](https://github.com/libp2p//github.com/libp2p/go-mplex/blob/master/multiplex.go/issues/L26)
@github-actions
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants