Skip to content
This repository was archived by the owner on Oct 26, 2022. It is now read-only.

Add ENOBUFS handling for unsolicited messages#293

Open
Tuetuopay wants to merge 1 commit intolittle-dude:masterfrom
Tuetuopay:handle-enobufs
Open

Add ENOBUFS handling for unsolicited messages#293
Tuetuopay wants to merge 1 commit intolittle-dude:masterfrom
Tuetuopay:handle-enobufs

Conversation

@Tuetuopay
Copy link
Copy Markdown
Contributor

This can happen when large burst of messages come all of a sudden, which happen very easily when routing protocols are involved (e.g. BGP). The current implementation incorrectly assumes that any failure to read from the socket is akin to the socket closed. This is not the case.

This adds handling for this specific error, which translates to a wrapper struct in the unsolicited messages stream: either a message, or an overrun. This lets applications handle best for their usecase such event: either resync because messages are lost, or do nothing if the listening is informational only (e.g. logging).

This PR fixes the issue raised in #139

@Tuetuopay
Copy link
Copy Markdown
Contributor Author

Duh idiot me forgot the tests... I'll fix them tomorrow.

@Tuetuopay Tuetuopay force-pushed the handle-enobufs branch 2 times, most recently from 363c861 to 58dd138 Compare October 1, 2022 12:26
This can happen when large burst of messages come all of a sudden, which
happen very easily when routing protocols are involved (e.g. BGP). The
current implementation incorrectly assumes that any failure to read from
the socket is akin to the socket closed. This is not the case.

This adds handling for this specific error, which translates to a
wrapper struct in the unsolicited messages stream: either a message, or
an overrun. This lets applications handle best for their usecase such
event: either resync because messages are lost, or do nothing if the
listening is informational only (e.g. logging).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant