From: Kern Sibbald Date: Sun, 30 Jul 2017 04:45:17 +0000 (+0200) Subject: Fix: bug #3048: jobs are stuck in endless loop in reserve.c X-Git-Tag: Release-9.0.3~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=18ab9a40fdf53ee447c5eb82ea4c9cfdcf375e4a;p=bacula%2Fbacula Fix: bug #3048: jobs are stuck in endless loop in reserve.c --- diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index eb04e620f4..5e0143a6e5 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -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");