From 0167e3a5756c028ce5c997dc033b428cdf10359a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 30 Nov 2007 21:29:53 +0000 Subject: [PATCH] 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/trunk@6001 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/2.2.6-maxruntime.patch | 34 +++++++++++++++++++++++++++ bacula/src/dird/job.c | 3 ++- bacula/technotes-2.3 | 3 +++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 bacula/patches/2.2.6-maxruntime.patch 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 1ffecf1db6..3bdddaa818 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.3 b/bacula/technotes-2.3 index 779dcb1f1d..9044407aba 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,9 @@ Technical notes on version 2.3 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. 29Nov07 ebl Apply Richard Mortimer patch that fixes #1016 when there are more than one "part" to write. Instead of each part being stored on disk, -- 2.39.5