sd-bus: break the loop in bus_ensure_running() if the bus is not connecting
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 14 Oct 2020 12:03:13 +0000 (14:03 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 Dec 2020 17:08:30 +0000 (18:08 +0100)
commit1e4257da8cf6743dee7628d6cc3bb72ad6348d8d
tree814fa803dc21df6cfd2c1467e33dee17be7c6ccb
parentfb68be763505c95e08b24f343ca62b04e7f7a151
sd-bus: break the loop in bus_ensure_running() if the bus is not connecting

This might fix #17025:
> the call trace is
> bus_ensure_running -> sd_bus_process -> bus_process_internal -> process_closeing --> sd_bus_close
>                                                                                  |
>                                                                                  \-> process_match

We ended doing callouts to the Disconnected matches from bus_ensure_running()
and shouldn't. bus_ensure_running() should never do callouts. This change
should fix this however: once we notice that the connection is going down we
will now fail instantly with ENOTOCONN instead of calling any callbacks.

(cherry picked from commit 93a59b1ae5d3bcb0ec1488ebc13d0d1ff4d1729a)
src/libsystemd/sd-bus/sd-bus.c