]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix: bug #3048: jobs are stuck in endless loop in reserve.c
authorKern Sibbald <kern@sibbald.com>
Sun, 30 Jul 2017 04:45:17 +0000 (06:45 +0200)
committerKern Sibbald <kern@sibbald.com>
Sun, 30 Jul 2017 04:45:28 +0000 (06:45 +0200)
bacula/src/stored/reserve.c

index eb04e620f4c372545ee9c5e3c635a05779632144..5e0143a6e53703e0d24df9acb14794a92e6d20bc 100644 (file)
@@ -403,8 +403,8 @@ static bool use_device_cmd(JCR *jcr)
           * This can happen if one job reserves a drive or finishes using
           * a drive at the same time a second job wants it.
           */
-         if (repeat++ > 1) {              /* try algorithm 3 times */
-            bmicrosleep(30, 0);           /* wait a bit */
+         if (repeat++ < 20) {             /* try sleeping 20 times */
+            bmicrosleep(30, 0);           /* wait 30 secs */
             Dmsg1(dbglvl, "repeat reserve algorithm JobId=%d\n", jcr->JobId);
          } else if (!rctx.suitable_device || !wait_for_any_device(jcr, wait_for_device_retries)) {
             Dmsg0(dbglvl, "Fail. !suitable_device || !wait_for_device\n");