Re: [systemd-devel] [PATCH] job: always add waiting jobs to run queue during coldplug.
On Tue, May 06, 2014 at 12:36:44PM -0700, Michael Marineau wrote: commit 20a83d7bf was not equivalent to the original bug fix proposed by Michal Sekletar msekl...@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. --- Applied. Thanks! src/core/job.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index 835cfe1..dc4f441 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1060,15 +1060,15 @@ int job_coldplug(Job *j) { if (r 0) return r; +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_time( j-manager-event, j-timer_event_source, -- 1.8.5.5 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] job: always add waiting jobs to run queue during coldplug.
On Tue, May 06, 2014 at 12:36:44PM -0700, Michael Marineau wrote: commit 20a83d7bf was not equivalent to the original bug fix proposed by Michal Sekletar msekl...@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. Good catch! I tottaly missed above return statement. Please push. Michal --- src/core/job.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index 835cfe1..dc4f441 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1060,15 +1060,15 @@ int job_coldplug(Job *j) { if (r 0) return r; +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_time( j-manager-event, j-timer_event_source, -- 1.8.5.5 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] job: always add waiting jobs to run queue during coldplug.
commit 20a83d7bf was not equivalent to the original bug fix proposed by Michal Sekletar msekl...@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. --- src/core/job.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/job.c b/src/core/job.c index 835cfe1..dc4f441 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1060,15 +1060,15 @@ int job_coldplug(Job *j) { if (r 0) return r; +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_time( j-manager-event, j-timer_event_source, -- 1.8.5.5 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel