]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/manager: Make sure jobs statistics are not double after daemon-reload
authorMichal Koutný <mkoutny@suse.com>
Fri, 22 Jun 2018 14:19:52 +0000 (16:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Jun 2018 09:18:44 +0000 (11:18 +0200)
We add n_installed_jobs and n_failed_jobs to our inner state after
deserialization. This is fine during daemon-reexec when we start with clear
Manager (and some jobs possibly queued before deserialization), however,
daemon-reload works with the same manager and adding the values would
effectively double the counters. Reset the counters before we deserialize and
add their values again.

src/core/manager.c

index 930df4e23afc409530ac5993bec636e6f2dc6338..a3ae481158e756f57e4e4f30aa3e169ecd345ead 100644 (file)
@@ -1234,6 +1234,8 @@ static void manager_clear_jobs_and_units(Manager *m) {
 
         m->n_on_console = 0;
         m->n_running_jobs = 0;
+        m->n_installed_jobs = 0;
+        m->n_failed_jobs = 0;
 }
 
 Manager* manager_free(Manager *m) {