]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove jobq.c constraint that read and write SD must be
authorKern Sibbald <kern@sibbald.com>
Sat, 25 Oct 2008 12:10:55 +0000 (12:10 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 25 Oct 2008 12:10:55 +0000 (12:10 +0000)
     different. This may lead to more deadlocks in the SD,
     but they should be resolved there.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7901 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/jobq.c
bacula/technotes-2.5

index 1e7fddc8442bd50e04e6a442a831b2b1c25520af..36bbe4764a75aae943f2887e4600582829566c70 100644 (file)
@@ -510,20 +510,20 @@ void *jobq_server(void *arg)
          if (re) {
             Priority = re->jcr->JobPriority;
             Dmsg2(2300, "JobId %d is running. Look for pri=%d\n",
-                 re->jcr->JobId, Priority);
-           running_allow_mix = true;
-           for ( ; re; ) {
-              Dmsg2(2300, "JobId %d is also running with %s\n",
-                    re->jcr->JobId, 
-                    re->jcr->job->allow_mixed_priority ? "mix" : "no mix");
-              if (!re->jcr->job->allow_mixed_priority) {
-                 running_allow_mix = false;
-                 break;
-              }
-              re = (jobq_item_t *)jq->running_jobs->next(re);
-           }
+                  re->jcr->JobId, Priority);
+            running_allow_mix = true;
+            for ( ; re; ) {
+               Dmsg2(2300, "JobId %d is also running with %s\n",
+                     re->jcr->JobId, 
+                     re->jcr->job->allow_mixed_priority ? "mix" : "no mix");
+               if (!re->jcr->job->allow_mixed_priority) {
+                  running_allow_mix = false;
+                  break;
+               }
+               re = (jobq_item_t *)jq->running_jobs->next(re);
+            }
             Dmsg1(2300, "The running job(s) %s mixing priorities.\n",
-                 running_allow_mix ? "allow" : "don't allow");
+                  running_allow_mix ? "allow" : "don't allow");
          } else {
             Priority = je->jcr->JobPriority;
             Dmsg1(2300, "No job running. Look for Job pri=%d\n", Priority);
@@ -538,13 +538,13 @@ void *jobq_server(void *arg)
             jobq_item_t *jn = (jobq_item_t *)jq->waiting_jobs->next(je);
 
             Dmsg4(2300, "Examining Job=%d JobPri=%d want Pri=%d (%s)\n",
-                 jcr->JobId, jcr->JobPriority, Priority,
-                 jcr->job->allow_mixed_priority ? "mix" : "no mix");
+                  jcr->JobId, jcr->JobPriority, Priority,
+                  jcr->job->allow_mixed_priority ? "mix" : "no mix");
 
             /* Take only jobs of correct Priority */
             if (!(jcr->JobPriority == Priority
-                 || (jcr->JobPriority < Priority &&
-                     jcr->job->allow_mixed_priority && running_allow_mix))) {
+                  || (jcr->JobPriority < Priority &&
+                      jcr->job->allow_mixed_priority && running_allow_mix))) {
                set_jcr_job_status(jcr, JS_WaitPriority);
                break;
             }
@@ -718,6 +718,14 @@ static bool acquire_resources(JCR *jcr)
    bool skip_this_jcr = false;
 
    jcr->acquired_resource_locks = false;
+/*
+ * Turning this code off is likely to cause some deadlocks,
+ *   but we do not really have enough information here to
+ *   know if this is really a deadlock (it may be a dual drive
+ *   autochanger), and in principle, the SD reservation system
+ *   should detect these deadlocks, so push the work off on is.
+ */
+#ifdef xxx
    if (jcr->rstore && jcr->rstore == jcr->wstore) {    /* possible deadlock */
       Jmsg(jcr, M_FATAL, 0, _("Job canceled. Attempt to read and write same device.\n"
          "    Read storage \"%s\" (From %s) -- Write storage \"%s\" (From %s)\n"), 
@@ -725,6 +733,7 @@ static bool acquire_resources(JCR *jcr)
       set_jcr_job_status(jcr, JS_Canceled);
       return false;
    }
+#endif
    if (jcr->rstore) {
       Dmsg1(200, "Rstore=%s\n", jcr->rstore->name());
       if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs) {
index 05beb8112bd40930be15b2cf312d9658e8c4f93c..bfec8585d37878e2e205ee7b12292cf56e683b65 100644 (file)
@@ -19,6 +19,9 @@ remove reader/writer in FOPTS????
 
 General:
 25Oct08
+kes  Remove jobq.c constraint that read and write SD must be
+     different. This may lead to more deadlocks in the SD,
+     but they should be resolved there.
 kes  Ensure that job report is always printed even if job is failed
      in the director.
 kes  Don't print job report twice for failed VBackup jobs.