From: Kern Sibbald Date: Fri, 30 Nov 2007 21:28:39 +0000 (+0000) Subject: This patch fixes bug #1012 where the job is canceled because X-Git-Tag: Release-2.2.7~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=10ad103dc12cbe4b812d4e8785b621de8cc84c83;p=bacula%2Fbacula This patch fixes bug #1012 where the job is canceled because 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 --- diff --git a/bacula/patches/2.2.6-maxruntime.patch b/bacula/patches/2.2.6-maxruntime.patch new file mode 100644 index 0000000000..decd466b0d --- /dev/null +++ b/bacula/patches/2.2.6-maxruntime.patch @@ -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 + patch -p0 <2.2.6-maxruntime.patch + ./configure + 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: diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index ac0fb26166..e1e96dbe28 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -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: diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index cb1147f25f..3aac551317 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -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.