Run the long-running D-Bus monitors on EventLoop - #24
Merged
Conversation
Migrate the pure-D-Bus monitor clients from enterEventLoopAsync() + monitorLoop() to the single-threaded EventLoop + SignalSource, matching the BlueZ clients. Each now drives its connection on the main thread and shuts down synchronously via the loop's signalfd instead of a bus-owned thread plus a 100ms poll. Migrated: bluez, geoclue2, login1, network1, networkmanager, resolve1, systemd1, udisks2, udisks2_monitor_daemon, upower, wpa_supplicant. Not migrated, by design: - connman keeps its reconnect-with-exponential-backoff model. Its lifecycle needs to stay responsive to SIGINT/SIGTERM while the system bus is down (before a connection exists), which the signalfd-only model can't do without a bus-less run() variant; the existing installSignalHandlers()/g_running path handles that correctly. - The one-shot clients that fetch and exit (avahi, flatpak, fwupd, hostname1, locale1, packagekit, timedate1) and the synchronous examples (realtimekit1, timesync1) are not long-running loops; running them under EventLoop would turn a fetch-and-exit into a daemon. Verified at runtime: login1 and systemd1 start, drive their D-Bus callbacks on the loop, and exit cleanly on SIGTERM. Full build green; clang-format --Werror and clang-tidy-19 clean. Signed-off-by: Joel Winarske <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Run the long-running D-Bus monitors on EventLoop
Migrate the pure-D-Bus monitor clients from enterEventLoopAsync() + monitorLoop() to the single-threaded EventLoop + SignalSource, matching the BlueZ clients. Each now drives its connection on the main thread and shuts down synchronously via the loop's signalfd instead of a bus-owned thread plus a 100ms poll.
Migrated: bluez, geoclue2, login1, network1, networkmanager, resolve1, systemd1, udisks2, udisks2_monitor_daemon, upower, wpa_supplicant.
Not migrated, by design:
locale1, packagekit, timedate1) and the synchronous examples (realtimekit1, timesync1) are not long-running loops; running them under EventLoop would turn a fetch-and-exit into a daemon.
Verified at runtime: login1 and systemd1 start, drive their D-Bus callbacks on
the loop, and exit cleanly on SIGTERM. Full build green; clang-format --Werror and clang-tidy-19 clean.