chiark / gitweb /
sd-bus: start reply callback timeouts only when the connection is established
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Dec 2017 12:53:12 +0000 (13:53 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:49:56 +0000 (07:49 +0200)
commit0cf9e6a973fa9d94343434b01d5eeac7ff25d887
treecc1158131d6f94bbefac358dbf274d8503c46e80
parent004bb7654fb0ca644e70ae22221adfecdcb4a8ed
sd-bus: start reply callback timeouts only when the connection is established

Currently, reply callback timeouts are started the instant the method
calls are enqueued, which can be very early on. For example, the Hello()
method call is enqueued right when sd_bus_start() is called, i.e. before
the socket connection and everything is established.

With this change we instead start the method timeout the moment we
actually leave the authentication phase of the connection. This way, the
timeout the kernel applies on socket connecting, and we apply on the
authentication phase no longer runs in parallel to the Hello() method
call, but all three run serially one after the other, which is
definitely a cleaner approach.

Moreover, this makes the "watch bind" feature a lot more useful, as it
allows enqueuing method calls while we are still waiting for inotify
events, without them timeouting until the connection is actually
established, i.e. when the method call actually has a chance of being
actually run.

This is a change of behaviour of course, but I think the new behaviour
is much better than the old one, since we don't race timeouts against
each other anymore...
src/libelogind/sd-bus/bus-internal.h
src/libelogind/sd-bus/bus-slot.c
src/libelogind/sd-bus/sd-bus.c