hashicorp / hashicorp/memberlist

UDPBufferSize is not enforced in SendBestEffort despite its docs

Open
#348 1 comment 0 reactions 1 assignee Claimed by @tgross View on GitHub
Dominant language
Go
Stars
4.1k
Forks
478
Avg merge
15h 58m
Merged PRs (30d)
3

Description

The docs of `SendBestEffort` state that "The maximum size of the message depends on the configured UDPBufferSize for this memberlist instance":
https://github.com/hashicorp/memberlist/blob/29437a621ed5ed7975fd156c5053076828246e44/memberlist.go#L582-L595

I understood this meant I could not send a message larger than `UDPBufferSize` bytes using `SendBestEffort`, but this is not the case. Nowhere in the `SendBestEffort` call chain (`SendBestEffort` -> `rawSendMsgPacket` -> `NodeAwareTransport.WriteToAddress`) is `UDPBufferSize` checked nor mentioned.

Where the library uses it is in `sendMsg` and `gossip`: both take it into account to "fill a UDP packet with piggybacked data" via `getBroadcast`.

Should the comment in `SendBestEffort` be removed, since it does not use it?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.