Erlang nodes fail to communicate if user has no capability to change SO_PRIORITY socket options.

Janek Wrobel wrr@REDACTED
Thu Jan 13 16:34:35 CET 2011


Hi,

When trying to setup an Erlang cluster I was getting following error
while spawning a function on a remote node:

=ERROR REPORT==== 13-Jan-2011::01:00:38 ===
** Can not start hello_world:ping,[] on 'node3@REDACTED' **

After some investigation it turned out that nodes did not accept TCP
connections, because setting SO_PRIORITY socket option failed. Strace
follows:

accept(7, {sa_family=AF_INET, sin_port=htons(51602),
sin_addr=inet_addr("123.123.123.123")}, [16]) = 10
fcntl(10, F_GETFL)                      = 0x2 (flags O_RDWR)
fcntl(10, F_SETFL, O_RDWR|O_NONBLOCK)   = 0
getsockopt(7, SOL_TCP, TCP_NODELAY, [29220483580821504], [4]) = 0
getsockopt(7, SOL_SOCKET, SO_KEEPALIVE, [29220483580821504], [4]) = 0
getsockopt(7, SOL_SOCKET, SO_PRIORITY, [29220483580821504], [4]) = 0
getsockopt(7, SOL_IP, IP_TOS, [29220483580821504], [4]) = 0
getsockopt(10, SOL_SOCKET, SO_PRIORITY, [-4294967281], [4]) = 0
getsockopt(10, SOL_IP, IP_TOS, [64424509440], [4]) = 0
setsockopt(10, SOL_IP, IP_TOS, [0], 4)  = 0
setsockopt(10, SOL_SOCKET, SO_PRIORITY, [15], 4) = -1 EPERM (Operation
not permitted)
close(10)

To make it working I needed to add '#undef SO_PRIORITY' to
erts/emulator/drivers/common/inet_drv.c and recompile.

Can errors from setsockopt(..., SO_PRIORITY) be ignored? According to
the socket(7) manual, it is normal for a user not to be able to change
this option ('Setting a priority outside the range 0 to 6 requires the
CAP_NET_ADMIN capability.').

thanks,
Jan Wrobel


More information about the erlang-bugs mailing list