hashicorp / hashicorp/memberlist
UDPBufferSize is not enforced in SendBestEffort despite its docs
- 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
Assessment
This issue has not been assessed yet.