Bug #11364
closedUse smaller buffer for sendmsg
Description
OpenBSD's limit is less than 128.
Files
Updated by Anonymous about 9 years ago
- Status changed from Open to Closed
Applied in changeset r51288.
test/socket/test_nonblock: use smaller buffer for sendmsg
OpenBSD's limit is less than 128.
- test/socket/test_nonblock: use smaller buffer for sendmsg
Patch-by: Jeremy Evans code@jeremyevans.net
[ruby-core:70016] [Bug #11364]
Updated by normalperson (Eric Wong) about 9 years ago
merch-redmine@jeremyevans.net wrote:
Bug #11364: Use smaller buffer for sendmsg
https://bugs.ruby-lang.org/issues/11364OpenBSD's limit is less than 128.
Btw, this is pretty disappointing since I want to use SOCK_SEQPACKET
more for IPC in some projects.
Does SO_RCVBUF/SO_SNDBUF help in OpenBSD with SOCK_SEQPACKET sockets?
Updated by normalperson (Eric Wong) about 9 years ago
Jeremy Evans code@jeremyevans.net wrote:
Looks like my initial analysis was partially wrong. OpenBSD's default
buffer for SEQPACKET sockets is 4096. However, ancdata.c needs a patch
to handle EMSGSIZE.
This looks like a bug in OpenBSD. I don't know in what standards an
application is expected to handle EMSGSIZE as a retryable error when
writing to a socket.
Maybe a version-guarded #ifdef for OpenBSD would be alright for now,
but I think this needs to be fixed in OpenBSD.
Updated by normalperson (Eric Wong) about 9 years ago
Jeremy Evans code@jeremyevans.net wrote:
This turns out to be a bug in the lower levels of the OpenBSD kernel,
specific to SEQPACKET. I've tested a patch that fixes it, it will
probably be in the next release.
Good to know!
The default socket buffer size for SEQPACKET sockets is actually 4096
on OpenBSD, so it may be better to increase the size values back, though
not all the way up to 8192. Below is a patch that does that.
Alright, I cranked it up to 4096 on both tests for consistency.
Thanks again for the heads up.
No problem, thanks for reporting these issues. It's great to know
SOCK_SEQPACKET is supported on OpenBSD, even.
Btw, there's some places where we're conservative and only enable some
features under Linux. For example, I just added another poll() user at
r51305 for Linux-only and there's the MSG_DONTWAIT_RELIABLE macro in
ext/socket/rubysocket.h It'd be great if *BSD users/devs could test
and enable these on *BSDs (fixing the kernels if necessary).