From d75e02a32171349298527ad1c406379669b3b794 Mon Sep 17 00:00:00 2001 From: Vratislav Podzimek Date: Fri, 11 Sep 2020 15:42:03 +0200 Subject: [PATCH] Only respect 'ifelapsed' if there is a previous promise evaluation If the promise is being evaluated for the first time (no records in the locks LMDB), it doesn't make sense to check 'ifelapsed' for it. --- libpromises/locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpromises/locks.c b/libpromises/locks.c index 43d571254d..2f40d5ee15 100644 --- a/libpromises/locks.c +++ b/libpromises/locks.c @@ -867,7 +867,7 @@ CfLock AcquireLock(EvalContext *ctx, const char *operand, const char *host, // For promises/locks with ifelapsed == 0, skip all detection logic of // previously acquired locks, whether in this agent or a parallel one. - if (ifelapsed != 0) + if ((ifelapsed != 0) && (lastcompleted != 0)) { if (elapsedtime < 0) {