]> git.sur5r.net Git - bacula/bacula/commitdiff
This patch fixes bug #1012 where the job is canceled because
authorKern Sibbald <kern@sibbald.com>
Fri, 30 Nov 2007 21:28:39 +0000 (21:28 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 30 Nov 2007 21:28:39 +0000 (21:28 +0000)
     of Max Run Time exceeded when the job has not yet started.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6000 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/2.2.6-maxruntime.patch [new file with mode: 0644]
bacula/src/dird/job.c
bacula/technotes-2.1

diff --git a/bacula/patches/2.2.6-maxruntime.patch b/bacula/patches/2.2.6-maxruntime.patch
new file mode 100644 (file)
index 0000000..decd466
--- /dev/null
@@ -0,0 +1,34 @@
+  This patch fixes bug #1012 where the job is canceled because
+  of Max Run Time exceeded when the job has not yet started.
+
+  Apply it to 2.2.6 or any prior 2.2.x version with:
+
+  cd <bacula-source>
+  patch -p0 <2.2.6-maxruntime.patch
+  ./configure <your-options>
+  make
+  ...
+  make install
+
+
+Index: src/dird/job.c
+===================================================================
+--- src/dird/job.c     (revision 5979)
++++ src/dird/job.c     (working copy)
+@@ -556,7 +556,7 @@
+  */
+ static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr)
+ {
+-   if (jcr->job->MaxRunTime == 0 || job_canceled(jcr)) {
++   if (jcr->job->MaxRunTime == 0 || job_canceled(jcr) || jcr->JobStatus == JS_Created) {
+       return false;
+    }
+    if ((watchdog_time - jcr->start_time) < jcr->job->MaxRunTime) {
+@@ -931,6 +931,7 @@
+ {
+    jcr->job = job;
+    jcr->JobType = job->JobType;
++   jcr->JobStatus = JS_Created;
+    switch (jcr->JobType) {
+    case JT_ADMIN:
+    case JT_RESTORE:
index ac0fb2616624e86f869fea11bc19a5f74c60decd..e1e96dbe28b9442181279a8d7a4eb9386961dd98 100644 (file)
@@ -556,7 +556,7 @@ static bool job_check_maxwaittime(JCR *control_jcr, JCR *jcr)
  */
 static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr)
 {
-   if (jcr->job->MaxRunTime == 0 || job_canceled(jcr)) {
+   if (jcr->job->MaxRunTime == 0 || job_canceled(jcr) || jcr->JobStatus == JS_Created) {
       return false;
    }
    if ((watchdog_time - jcr->start_time) < jcr->job->MaxRunTime) {
@@ -931,6 +931,7 @@ void set_jcr_defaults(JCR *jcr, JOB *job)
 {
    jcr->job = job;
    jcr->JobType = job->JobType;
+   jcr->JobStatus = JS_Created;
    switch (jcr->JobType) {
    case JT_ADMIN:
    case JT_RESTORE:
index cb1147f25f598536af25dc9bda0b35ceffac3df5..3aac5513177ef33d7373c4daaeccbfc06394b1e8 100644 (file)
@@ -1,6 +1,11 @@
               Technical notes on version 2.2
 
 General:
+30Nov07
+kes  This patch fixes bug #1012 where the job is canceled because
+     of Max Run Time exceeded when the job has not yet started.
+27Nov07
+kes  Correct typos in disk-changer.in
 25Nov07
 kes  This patch fixes the status command to include the formating string for
      JS_AttrInsterting.  It fixes bug #1021.