• Lennart Poettering's avatar
    sysdeps: increase listen() backlog of AF_UNIX sockets to SOMAXCONN · 12bd6e89
    Lennart Poettering authored
    Previously, the listen() backlog was set to an arbitrary 30. This means
    that if dbus-daemon is overloaded only 30 more connections may be queued
    by the kernel, before connect() fails with EAGAIN. (Note that EAGAIN !=
    EINPROGRESS -- the latter is what is returned if a connection is queued
    and being processed for asynchronous sockets; EAGAIN in this case is
    really an error, that cannot be recovered from).
    
    Most software simply sets SOMAXCONN as backlog for AF_UNIX sockets, to
    allow queuing of as many connections as the kernel allows. SOMAXCONN is
    128 on Linux, which is not particularly high, but at least higher than
    30.
    
    This patch changes dbus-daemon to do the same.
    
    I noticed this when flooding dbus-daemon with a lot of connections,
    where it pretty quickly ceased to respond, much earlier than it really
    should.
    
    Note that the backlog has nothing to do with the number of concurrent
    connections allowed, it simply controls how many queued, but not
    accept()ed connections there may be on the listening socket.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=95264
    12bd6e89
Name
Last commit
Last update
bus Loading commit data...
cmake Loading commit data...
dbus Loading commit data...
doc Loading commit data...
m4 Loading commit data...
test Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
ChangeLog.pre-1-0 Loading commit data...
ChangeLog.pre-1-2 Loading commit data...
Doxyfile.in Loading commit data...
HACKING Loading commit data...
INSTALL Loading commit data...
Makefile.am Loading commit data...
Makefile.cvs Loading commit data...
NEWS Loading commit data...
NEWS.pre-1-0 Loading commit data...
NEWS.pre-1-2 Loading commit data...
README Loading commit data...
README.cmake Loading commit data...
README.cygwin Loading commit data...
README.launchd Loading commit data...
README.valgrind Loading commit data...
README.win Loading commit data...
README.wince Loading commit data...
autogen.sh Loading commit data...
cleanup-man-pages.sh Loading commit data...
configure.ac Loading commit data...
dbus-1-uninstalled.pc.in Loading commit data...
dbus-1.pc.in Loading commit data...