]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Apply 2.4.2-cancel-non-running-jobs.patch to be able to cancel
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 10 Oct 2008 10:58:59 +0000 (10:58 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 10 Oct 2008 10:58:59 +0000 (10:58 +0000)
     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

bacula/patches/2.4.2-cancel-non-running-jobs.patch [new file with mode: 0644]
bacula/src/dird/job.c
bacula/technotes-2.4

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 (file)
index 0000000..a1398da
--- /dev/null
@@ -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 <bacula-source>
+  patch -p0 <2.4.2-cancel-non-running-jobs.patch
+  ./configure <your-options>
+  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:
+
index ec0c3b6fb2d87085004a4f45c49e699b293f955f..5ee7cd02bd1069f75f066462f192f21ddb9bc83b 100644 (file)
@@ -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:
index 17bcc1240e1bbd3bef38b0cb182b54b8c4564565..3cc2d5a794031f8d287fdb1c1e316cb72b4a9822 100644 (file)
@@ -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