)]}'
{"zaqar/queues/storage/redis/claims.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"f1537607a83f066d79a3508d9af4a9d454603c70","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        # number of messages per claim. This is obviously # slower"},{"line_number":123,"context_line":"        # than keeping a side counter, but is also less error-prone,"},{"line_number":124,"context_line":"        # and avoids having to do a lot of extra work during garbage"},{"line_number":125,"context_line":"        # collection passes."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        claims_set_key \u003d utils.scope_claims_set(queue, project,"},{"line_number":128,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_53600b01","line":125,"updated":"2014-09-03 08:09:47.000000000","message":"Another side effect is that it is probably not as accurate. Some messages may expire or even be unclaimed before the claim count ends.\n\nI\u0027m starting to grow a bit worried about all the iterations we\u0027re doing over existing messages. Is this something we can change/improve later on?\n\nWould lua scripts take care of this?","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"fd14a9334dbd471a9ada4adbedc983b469de16a8","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        # number of messages per claim. This is obviously # slower"},{"line_number":123,"context_line":"        # than keeping a side counter, but is also less error-prone,"},{"line_number":124,"context_line":"        # and avoids having to do a lot of extra work during garbage"},{"line_number":125,"context_line":"        # collection passes."},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        claims_set_key \u003d utils.scope_claims_set(queue, project,"},{"line_number":128,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_eb49f8b7","line":125,"in_reply_to":"fa98f980_53600b01","updated":"2014-09-03 14:50:32.000000000","message":"\u003e Some messages may expire or even be unclaimed before the claim count ends.\n\nI tried to mitigate this somewhat by adding the \u0027n\u0027 field to claims, so that we only have to iterate claims, not individual messages.\n\nIt takes ~0.8 milliseconds to read a range of records from a sorted set on my macbook. For a huge worker pool of say 1000 workers, that would be 8 ms to do the count, but my gut tells me this is going to be a rare case. That being said, I\u0027m sure this could be sped up using Lua. However, we need to know if we can require Redis \u003e\u003d 2.6 if we go that route (alternatively, have a fallback for 2.4). CentOS 6.5 installs 2.4 from epel, and if we get rid of the sqla data plane as planned, we will need to gate on Redis, nicht?\n\n\u003e I\u0027m starting to grow a bit worried about all the iterations we\u0027re doing over existing messages.\n\nThere are definitely some other places that can be optimized, I agree. find_first_unclaimed comes to mind.\n\n\u003e Would lua scripts take care of this?\n\nI think we could probably rewrite most of the logic in Lua and it would be insanely fast.\n\nThat being said, in some cases we will still have to scan a sorted set or list, and in that case it would probably make sense for the lua scripts to only iterate over one batch at a time, so we don\u0027t lock up the DB for too long (allowing other requests to be interleaved).","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"}],"zaqar/queues/storage/redis/messages.py":[{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"fd14a9334dbd471a9ada4adbedc983b469de16a8","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            pipe.delete(message_id)"},{"line_number":514,"context_line":"            pipe.zrem(msgset_key, message_id)"},{"line_number":515,"context_line":""},{"line_number":516,"context_line":"            pipe.execute()"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    @utils.raises_conn_error"},{"line_number":519,"context_line":"    @utils.retries_on_connection_error"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_c66a6980","line":516,"updated":"2014-09-03 14:50:32.000000000","message":"Actually still need to decrement the \u0027n\u0027 counter in the claim. I guess this is ending up more like a hybrid approach. I\u0027ll fix in the next patchset...","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"}],"zaqar/queues/storage/redis/queues.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"f1537607a83f066d79a3508d9af4a9d454603c70","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        message_stats \u003d {"},{"line_number":200,"context_line":"            \u0027claimed\u0027: claimed,"},{"line_number":201,"context_line":"            \u0027free\u0027: total - claimed,"},{"line_number":202,"context_line":"            \u0027total\u0027: total,"},{"line_number":203,"context_line":"        }"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if total:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_333f07d8","line":202,"updated":"2014-09-03 08:09:47.000000000","message":"NIT: `,` not needed","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"fd14a9334dbd471a9ada4adbedc983b469de16a8","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        message_stats \u003d {"},{"line_number":200,"context_line":"            \u0027claimed\u0027: claimed,"},{"line_number":201,"context_line":"            \u0027free\u0027: total - claimed,"},{"line_number":202,"context_line":"            \u0027total\u0027: total,"},{"line_number":203,"context_line":"        }"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if total:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_6b16e856","line":202,"in_reply_to":"fa98f980_333f07d8","updated":"2014-09-03 14:50:32.000000000","message":"That\u0027s actually part of HACKING: http://docs.openstack.org/developer/hacking/#dictionaries-lists","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"f1537607a83f066d79a3508d9af4a9d454603c70","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            except errors.QueueIsEmpty:"},{"line_number":210,"context_line":"                pass"},{"line_number":211,"context_line":"            else:"},{"line_number":212,"context_line":"                message_stats[\u0027newest\u0027] \u003d newest"},{"line_number":213,"context_line":"                message_stats[\u0027oldest\u0027] \u003d oldest"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        return {\u0027messages\u0027: message_stats}"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_1311235d","line":212,"updated":"2014-09-03 08:09:47.000000000","message":"Should these keys be set anyway?","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"fd14a9334dbd471a9ada4adbedc983b469de16a8","unresolved":false,"context_lines":[{"line_number":209,"context_line":"            except errors.QueueIsEmpty:"},{"line_number":210,"context_line":"                pass"},{"line_number":211,"context_line":"            else:"},{"line_number":212,"context_line":"                message_stats[\u0027newest\u0027] \u003d newest"},{"line_number":213,"context_line":"                message_stats[\u0027oldest\u0027] \u003d oldest"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        return {\u0027messages\u0027: message_stats}"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa98f980_a6ae45e4","line":212,"in_reply_to":"fa98f980_1311235d","updated":"2014-09-03 14:50:32.000000000","message":"They are not always set in the mongo and sqla drivers. If we want to change these, we would need to do it for all drivers.","commit_id":"f9ccab145df41cc544f7676af4b5027d28b5e21e"}]}
