Currently claimed messages can be claimed (redis)

Bug #1579588 reported by Eva Balycheva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
New
Undecided
Eva Balycheva

Bug Description

The statement in this comment is not true:
https://github.com/openstack/zaqar/blob/stable/mitaka/zaqar/storage/redis/scripts/claim_messages.lua#L51

Imagine an example list of messages taken from db:

message 1: claimed
message 2: claimed
message 3: unclaimed, because claim is already expired (for example, a worker hasn't succeed in processing the message)
message 4: claimed
message 5: claimed

The comment in Zaqar code states:
"Since execution of this script can not happen in parallel, once we find the first unclaimed
message, the remaining messages will always be unclaimed as well."

But when Zaqar will find the unclaimed "message 3", it will assume that the next messages (4, 5) are unclaimed too. Zaqar will claim not only "message 3", but also "message 4" and "message 5", which is wrong.

I tested it(http://paste.openstack.org/show/6KYk1fPumWteuCR8aDIr/) and yes, this is what happens in such case.

Tags: redis
Eva Balycheva (ubershy)
Changed in zaqar:
assignee: nobody → Eva Balycheva (ubershy)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.