From d26f7923f6f283a5e5fe8b5add4c98f57feeb8e2 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 10 Oct 2008 10:58:59 +0000 Subject: [PATCH] ebl Apply 2.4.2-cancel-non-running-jobs.patch to be able to cancel a non created job faster. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7744 91ce42f0-d328-0410-95d8-f526ca767f89 --- .../2.4.2-cancel-non-running-jobs.patch | 31 +++++++++++++++++++ bacula/src/dird/job.c | 3 +- bacula/technotes-2.4 | 3 ++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 bacula/patches/2.4.2-cancel-non-running-jobs.patch diff --git a/bacula/patches/2.4.2-cancel-non-running-jobs.patch b/bacula/patches/2.4.2-cancel-non-running-jobs.patch new file mode 100644 index 0000000000..a1398dadfa --- /dev/null +++ b/bacula/patches/2.4.2-cancel-non-running-jobs.patch @@ -0,0 +1,31 @@ + + This patch causes that jobs not yet created are now removed from + the work queue just after the cancel command. + + It can be applied to 2.4.2 (not to previous versions) with: + + cd + patch -p0 <2.4.2-cancel-non-running-jobs.patch + ./configure + make + ... + make install + +Index: src/dird/job.c +=================================================================== +--- src/dird/job.c (révision 7681) ++++ src/dird/job.c (copie de travail) +@@ -354,10 +354,11 @@ + { + BSOCK *sd, *fd; + char ed1[50]; ++ int32_t old_status = jcr->JobStatus; + + set_jcr_job_status(jcr, JS_Canceled); + +- switch (jcr->JobStatus) { ++ switch (old_status) { + case JS_Created: + case JS_WaitJobRes: + case JS_WaitClientRes: + diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index ec0c3b6fb2..5ee7cd02bd 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -354,10 +354,11 @@ bool cancel_job(UAContext *ua, JCR *jcr) { BSOCK *sd, *fd; char ed1[50]; + int32_t old_status = jcr->JobStatus; set_jcr_job_status(jcr, JS_Canceled); - switch (jcr->JobStatus) { + switch (old_status) { case JS_Created: case JS_WaitJobRes: case JS_WaitClientRes: diff --git a/bacula/technotes-2.4 b/bacula/technotes-2.4 index 17bcc1240e..3cc2d5a794 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -2,6 +2,9 @@ General: 08Oct08 +ebl Apply 2.4.2-cancel-non-running-jobs.patch to be able to cancel + a non created job faster. +08Oct08 kes This should correct bug #1159 where Migration does not properly respect the Migration Low Bytes directive. 02Oct08 -- 2.39.5