Releasing a claim not releasing (immediately)

Bug #1210633 reported by Amit Gandhi
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zaqar
Fix Released
Critical
Allele Dev

Bug Description

To Reproduce:

1. POST a new message to the queue
2. POST a claim to claim a message
3. DELETE the claim to release that message
4. GET the list of messages for the queue - notice that the released message is still not in the list of messages in that queue for another worker to claim.

Expected Behavior:

The released message should be in the list of messages (include_claimed = false).

Allele Dev (alleledev)
Changed in marconi:
status: New → Confirmed
Kurt Griffiths (kgriffs)
Changed in marconi:
importance: Undecided → Critical
Revision history for this message
Allele Dev (alleledev) wrote :

Here's the repro using httpie:

auth=<auth_token>
marconi=<endpoint>

http put $marconi/v1/queues/taco x-auth-token:$auth
http post $marconi/v1/queues/taco/messages x-auth-token:$auth client-id:1 < messages.json
http post $marconi/v1/queues/taco/claims x-auth-token:$auth
http delete $marconi/<claim location>

Expected behavior:

http get $marconi/v1/queues/taco/messages?echo=true x-auth-token:$auth client-id:1

HTTP/1.1 200 OK
Content-Length: 708
Content-Location: /v1/queues/taco/messages?echo=true
Content-Type: application/json; charset=utf-8

{
    "links": [
        {
            "href": "/v1/queues/taco/messages?marker=5&include_claimed=true&echo=true",
            "rel": "next"
        }
    ],
    "messages": [
        {
            "age": 89,
            "body": {
                "taco": "delicious1"
            },
            "href": "/v1/queues/taco/messages/5208fbda6f1ecd738983ab5f",
            "ttl": 200
        },
        {
            "age": 89,
            "body": {
                "taco": "delicious2"
            },
            "href": "/v1/queues/taco/messages/5208fbda6f1ecd738983ab60",
            "ttl": 200
        },
        {
            "age": 89,
            "body": {
                "taco": "delicious3"
            },
            "href": "/v1/queues/taco/messages/5208fbda6f1ecd738983ab61",
            "ttl": 200
        },
        {
            "age": 89,
            "body": {
                "taco": "delicious4"
            },
            "href": "/v1/queues/taco/messages/5208fbda6f1ecd738983ab62",
            "ttl": 200
        },
        {
            "age": 89,
            "body": {
                "taco": "delicious5"
            },
            "href": "/v1/queues/taco/messages/5208fbda6f1ecd738983ab63",
            "ttl": 200
        }
    ]
}

Actual behavior:

HTTP/1.1 204 No Content
Content-Location: /v1/queues/taco/messages?echo=true

# messages.json

[
  {
    "ttl": 100,
    "body" : {
      "taco": "delicious1"
    }
  },
  {
    "ttl": 100,
    "body" : {
      "taco": "delicious2"
    }
  },
  {
    "ttl": 100,
    "body" : {
      "taco": "delicious3"
    }
  },
  {
    "ttl": 100,
    "body" : {
      "taco": "delicious4"
    }
  },
  {
    "ttl": 100,
    "body" : {
      "taco": "delicious5"
    }
  }
]

Revision history for this message
Allele Dev (alleledev) wrote :

Sorry, the last comment was a little misleading. Correcting:

'''
Actual response:

HTTP/1.1 204 No Content
Content-Location: /v1/queues/taco/messages?echo=true
'''

message.json attached.

Allele Dev (alleledev)
Changed in marconi:
assignee: nobody → Alejandro Cabrera (cpp-cabrera)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to marconi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/41491

Changed in marconi:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to marconi (master)

Reviewed: https://review.openstack.org/41491
Committed: http://github.com/stackforge/marconi/commit/ed40dfd17ce5ec6da8d718181a43abb3bc78cc50
Submitter: Jenkins
Branch: master

commit ed40dfd17ce5ec6da8d718181a43abb3bc78cc50
Author: Alejandro Cabrera <email address hidden>
Date: Mon Aug 12 14:31:55 2013 -0400

    fix(storage/mongo): unclaimed messages not listed

    Adds a unit test that reproduces this error and applies the fix.

    The fix is subtle. When messages are unclaimed, their claim expiration
    time and claim ID are set to 0 and None respectively. The cause for
    the bug is that claim expiration time is set to 0, rather than a valid
    datetime object. As a result, the comparison silently fails.

    The fix: fast-forward the expiration time of a claim to now.

    Change-Id: I7781795c394b2a471012e072a522ee228d56a894
    Closes-Bug: #1210633

Changed in marconi:
status: In Progress → Fix Committed
Changed in marconi:
status: Fix Committed → Fix Released
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.