bus-unit-util: extend the bus call timeout for UnitFreezer
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 11 Jun 2024 10:19:39 +0000 (12:19 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 11 Jun 2024 13:56:00 +0000 (14:56 +0100)
Follow-up for 1d617b35fef5f7783287965f766c8bb85e932b8e.
Should fix https://github.com/systemd/systemd/issues/33269.

From the logs in the bug:
Jun 10 22:55:37 systemd-logind[909]: The system will suspend now!
Jun 10 22:55:37 ModemManager[996]: <msg> [sleep-monitor-systemd] system is about to suspend
...
Jun 10 22:55:48 systemd-sleep[422408]: Failed to freeze unit 'user.slice': Connection timed out
Jun 10 22:55:48 systemd-sleep[422408]: Performing sleep operation 'suspend'...

The delay is ~11 s, consistent with the patch that set the timeout to 10 s.
Looks like this is not enough. It's the freeze operation that fails, but
thawing might be slow too, so just bump the timeout again.

src/shared/bus-unit-util.c

index 22dbf62ab2d0719b4e9fc43b11d6b2e2722ae5da..da83422524fa438c3bac950c4b6be39335e3f233 100644 (file)
@@ -2945,8 +2945,8 @@ typedef struct UnitFreezer {
         sd_bus *bus;
 } UnitFreezer;
 
-/* Wait for 10 seconds at maximum for freezer operation */
-#define FREEZE_BUS_CALL_TIMEOUT (10 * USEC_PER_SEC)
+/* Wait for 60 seconds at maximum for freezer operation */
+#define FREEZE_BUS_CALL_TIMEOUT (60 * USEC_PER_SEC)
 
 UnitFreezer* unit_freezer_free(UnitFreezer *f) {
         if (!f)