]> git.sur5r.net Git - bacula/bacula/commitdiff
Reschedule on error caused EndTime to be incorrect -- fixes bug #2029
authorKern Sibbald <kern@sibbald.com>
Sat, 3 May 2014 10:06:49 +0000 (12:06 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 3 May 2014 10:06:49 +0000 (12:06 +0200)
bacula/src/cats/sql_update.c
bacula/src/dird/jobq.c

index 302d5e2337efa193cdcd77afd8a9c5b38b1ddbac..a6c6baab825a7d4e2b1131c3a7a1ce6a921816c4 100644 (file)
@@ -164,8 +164,8 @@ db_update_job_end_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr)
    ttime = jr->EndTime;
    (void)localtime_r(&ttime, &tm);
    strftime(dt, sizeof(dt), "%Y-%m-%d %H:%M:%S", &tm);
-
-   if (jr->RealEndTime == 0) {
+                                            
+   if (jr->RealEndTime == 0 || jr->RealEndTime < jr->EndTime) {
       jr->RealEndTime = jr->EndTime;
    }
    ttime = jr->RealEndTime;
index e9f9343711d217b563647b601b2d2520947a33db..f28c68124c6420f4cc15b5d9fb7b9d38c386f085 100644 (file)
@@ -653,6 +653,11 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je)
          if (jcr->wasVirtualFull) {
             jcr->setJobLevel(L_VIRTUAL_FULL);
          }
+         /* 
+          * When we are using the same jcr then make sure to reset
+          *   RealEndTime back to zero.  
+          */
+         jcr->jr.RealEndTime = 0;
          jobq_add(jq, jcr);     /* queue the job to run again */
          P(jq->mutex);
          free_jcr(jcr);         /* release jcr */