From: Michal Sekletar Date: Fri, 9 Jan 2026 16:18:41 +0000 (+0100) Subject: core: only activate transaction that contain useful jobs X-Git-Tag: v260-rc1~396 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcbf80c43d107ad233edc990a60bdc40f517085a;p=thirdparty%2Fsystemd.git core: only activate transaction that contain useful jobs If no real jobs were added to the transaction, do not activate it. The JOB_NOP anchor does not perform any useful work and activating such transaction only wastes resources. Fixes #9751 --- diff --git a/src/core/manager.c b/src/core/manager.c index 490b209d998..508b9fc9345 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2278,6 +2278,11 @@ int manager_propagate_reload(Manager *m, Unit *unit, JobMode mode, sd_bus_error tr->anchor_job, mode == JOB_IGNORE_DEPENDENCIES ? TRANSACTION_IGNORE_ORDER : 0); + /* Only activate the transaction if it contains jobs other than NOP anchor. + * Short-circuiting here avoids unnecessary processing, such as emitting D-Bus signals. */ + if (hashmap_size(tr->jobs) <= 1) + return 0; + r = transaction_activate(tr, m, mode, NULL, e); if (r < 0) return r;