From 18ab9a40fdf53ee447c5eb82ea4c9cfdcf375e4a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 30 Jul 2017 06:45:17 +0200 Subject: [PATCH] Fix: bug #3048: jobs are stuck in endless loop in reserve.c --- bacula/src/stored/reserve.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"); -- 2.39.5