]> git.sur5r.net Git - bacula/bacula/commitdiff
Ensure cancel status is set for canceled duplicate jobs -- partial fix for bug #1851
authorKern Sibbald <kern@sibbald.com>
Sun, 10 Jun 2012 07:42:41 +0000 (09:42 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:47 +0000 (14:50 +0200)
bacula/src/dird/job.c

index f769d20881e5c77cc39a5b3b3e661a9780582ccc..dae019bc7cf0552474dc2e543946319e0800ef9d 100644 (file)
@@ -762,6 +762,7 @@ bool allow_duplicate_job(JCR *jcr)
              */
             if (cancel_me) {
               /* Zap current job */
+              jcr->setJobStatus(JS_Canceled);
               Jmsg(jcr, M_FATAL, 0, _("JobId %d already running. Duplicate job not allowed.\n"),
                  djcr->JobId);
               break;     /* get out of foreach_jcr */
@@ -796,6 +797,7 @@ bool allow_duplicate_job(JCR *jcr)
             Jmsg(jcr, M_INFO, 0, _("Cancelling duplicate JobId=%d.\n"), djcr->JobId);
             cancel_job(ua, djcr);
             bmicrosleep(0, 500000);
+            djcr->setJobStatus(JS_Canceled);
             cancel_job(ua, djcr);
             free_ua_context(ua);
             Dmsg2(800, "Cancel dup %p JobId=%d\n", djcr, djcr->JobId);
@@ -803,6 +805,7 @@ bool allow_duplicate_job(JCR *jcr)
             /*
              * Zap current job
              */
+            jcr->setJobStatus(JS_Canceled);
             Jmsg(jcr, M_FATAL, 0, _("JobId %d already running. Duplicate job not allowed.\n"),
                djcr->JobId);
             Dmsg2(800, "Cancel me %p JobId=%d\n", jcr, jcr->JobId);