mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-10-03 23:38:39 +00:00
job: always add waiting jobs to run queue during coldplug
commit20a83d7bfwas not equivalent to the original bug fix proposed by Michal Sekletar <msekleta@redhat.com>. The committed version only added the job to the run queue if the job had a timeout, which most jobs do not have. Just re-ordering the code gets us the intended functionality (cherry picked from commit1727a59522) Conflicts: src/core/job.c
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
39cdf9313c
commit
ae6feb2a01
+3
-3
@@ -1051,15 +1051,15 @@ int job_coldplug(Job *j) {
|
||||
|
||||
assert(j);
|
||||
|
||||
if (j->state == JOB_WAITING)
|
||||
job_add_to_run_queue(j);
|
||||
|
||||
if (j->begin_usec == 0 || j->unit->job_timeout == 0)
|
||||
return 0;
|
||||
|
||||
if (j->timer_event_source)
|
||||
j->timer_event_source = sd_event_source_unref(j->timer_event_source);
|
||||
|
||||
if (j->state == JOB_WAITING)
|
||||
job_add_to_run_queue(j);
|
||||
|
||||
r = sd_event_add_monotonic(j->manager->event, &j->timer_event_source, j->begin_usec + j->unit->job_timeout, 0, job_dispatch_timer, j);
|
||||
if (r < 0)
|
||||
log_debug("Failed to restart timeout for job: %s", strerror(-r));
|
||||
|
||||
Reference in New Issue
Block a user