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)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Oct 2020 02:15:03 +0000 (11:15 +0900)
commit93a59b1ae5d3bcb0ec1488ebc13d0d1ff4d1729a
tree960885d8fd77674efb1f6faab01ad0542242c2fc
parent720f477f2db9145188d8b3dc1f8fe2f8e8c293c1
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.
src/libsystemd/sd-bus/sd-bus.c