Project

General

Profile

Actions

Bug #11364

closed

Use smaller buffer for sendmsg

Added by jeremyevans0 (Jeremy Evans) almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-07-16 openbsd 51261) [x86_64-openbsd]
[ruby-core:70016]

Description

OpenBSD's limit is less than 128.


Files

0002-Use-smaller-buffer-for-sendmsg.patch (1.01 KB) 0002-Use-smaller-buffer-for-sendmsg.patch jeremyevans0 (Jeremy Evans), 07/17/2015 09:32 PM
Actions #1

Updated by Anonymous almost 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.

Updated by normalperson (Eric Wong) almost 9 years ago

wrote:

Bug #11364: Use smaller buffer for sendmsg
https://bugs.ruby-lang.org/issues/11364

OpenBSD'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) almost 9 years ago

Jeremy Evans 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) almost 9 years ago

Jeremy Evans 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).

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0