From 9bd389e0a0f7329535f63ca649caf46e4633273c Mon Sep 17 00:00:00 2001 From: Asher Feldman Date: Mon, 23 Apr 2018 14:08:45 -0700 Subject: [PATCH] fix(queue): atomicity fix in read_message --- .../src/main/kotlin/com/netflix/spinnaker/q/redis/RedisQueue.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keiko-redis/src/main/kotlin/com/netflix/spinnaker/q/redis/RedisQueue.kt b/keiko-redis/src/main/kotlin/com/netflix/spinnaker/q/redis/RedisQueue.kt index 163d123..a129eac 100644 --- a/keiko-redis/src/main/kotlin/com/netflix/spinnaker/q/redis/RedisQueue.kt +++ b/keiko-redis/src/main/kotlin/com/netflix/spinnaker/q/redis/RedisQueue.kt @@ -453,7 +453,7 @@ private const val READ_MESSAGE_WITH_LOCK = """ local i=1 while (i <= #fingerprints) do redis.call("ECHO", "attempting lock on " .. fingerprints[i]) - if redis.call("SET", locksKey .. ":" .. fingerprints[i], "\uD83D\uDD12", "EX", lockTtlSeconds, "NX") ~= nil then + if redis.call("SET", locksKey .. ":" .. fingerprints[i], "\uD83D\uDD12", "EX", lockTtlSeconds, "NX") then redis.call("ECHO", "acquired lock on " .. fingerprints[i]) return fingerprints[i], fingerprints[i+1] end