)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"df513b13a7f06321be35404783f95c5272de3018","unresolved":false,"context_lines":[{"line_number":12,"context_line":"PS SSL connections to redis is not supported"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib7c100afd11a0410c3f241c1925d5aaf172ce6a8"},{"line_number":15,"context_line":"Partially-Implements:bp/redis-storage-driver"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1ae5cdf2_dd4470b9","line":15,"updated":"2014-06-17 05:29:28.000000000","message":"Partially-Implements:bp/redis-storage-driver -\u003e\n\nPartially-Implements: bp/redis-storage-driver\n\nIt needs that one whitespace so that gerrit automatically recognizes it. :)","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":3,"context_line":"AuthorDate: 2014-06-24 13:31:32 +0800"},{"line_number":4,"context_line":"Commit:     Prashanth Raghu \u003cp.isprashanth@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-06-24 13:31:32 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"The patch has implementations for the Queue and Message"},{"line_number":8,"context_line":"controllers for the redis backend"},{"line_number":9,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1ae5cdf2_b760af0e","line":6,"updated":"2014-06-24 06:11:49.000000000","message":"Have you miss the brief description of the change in the first line?","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"5c8bad9591c402f5c88bb1e943da0b583d858ef3","unresolved":false,"context_lines":[{"line_number":9,"context_line":"The patch has implementations for the Queue and Message"},{"line_number":10,"context_line":"controllers for the redis backend"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Also incorporates comments from flwang, sriram and"},{"line_number":13,"context_line":"alcabrera"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"PS SSL connections to redis is not supported"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"baada198_44bb440e","line":12,"updated":"2014-07-01 02:11:39.000000000","message":"Do we need this? -:)","commit_id":"2dcaa00606cec19bec61114b66560d0e39b236b1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":12,"context_line":"PS SSL connections to redis is not supported"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib7c100afd11a0410c3f241c1925d5aaf172ce6a8"},{"line_number":15,"context_line":"Partially-Implements: bp/redis-storage-driver"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":13,"id":"baada198_a250342d","line":15,"updated":"2014-07-31 16:43:47.000000000","message":"STYLE: \"bp\" \u003d\u003d\u003e \"blueprint\", e.g.:\n\nPartially-Implements: blueprint redis-storage-driver","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"}],"etc/marconi.conf.sample":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":213,"context_line":"#reconnect_sleep\u003d0.02"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"[drivers:storage:redis]"},{"line_number":216,"context_line":"# Redis Connection URI "},{"line_number":217,"context_line":"#uri\u003d\u003cNone\u003e "},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# Database number "}],"source_content_type":"application/octet-stream","patch_set":5,"id":"baada198_2c60b934","line":216,"updated":"2014-07-10 10:27:09.000000000","message":"Please remove the white space","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":216,"context_line":"# Redis Connection URI "},{"line_number":217,"context_line":"#uri\u003d\u003cNone\u003e "},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# Database number "},{"line_number":220,"context_line":"#database\u003d0 "},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"# Maximum number of times to retry a failed operation. "}],"source_content_type":"application/octet-stream","patch_set":5,"id":"baada198_2cc7d913","line":219,"updated":"2014-07-10 10:27:09.000000000","message":"Would you mind adding more details about this entry?","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":7498,"name":"Malini Kamalambal","email":"malini.kamalambal@rackspace.com","username":"malini-pk"},"change_message_id":"4d5547cd88fa071f6bef0953f851d6fbff3627bd","unresolved":false,"context_lines":[{"line_number":241,"context_line":"# due to a primary node failover. (integer value)"},{"line_number":242,"context_line":"#max_reconnect_attempts\u003d10"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"# Base sleep interval between attempts to reconnect after a "},{"line_number":245,"context_line":"# primary node failover. The actual sleep time increases"},{"line_number":246,"context_line":"# exponentially (power of 2) each time the operation is"},{"line_number":247,"context_line":"# retried. (floating point value)"}],"source_content_type":"application/octet-stream","patch_set":6,"id":"baada198_80444fb8","line":244,"updated":"2014-07-16 16:07:36.000000000","message":"nit: Can you get rid of the whitespace?","commit_id":"6d294cfe349da72d0b2d9ee6df97540bd3d74501"}],"marconi/queues/storage/redis/catalogue.py":[{"author":{"_account_id":8092,"name":"Sriram Madapusi Vasudevan","email":"sriram1991mv@gmail.com","username":"thesriram"},"change_message_id":"3b52a8acfb67ee8f4d6ed29e5ffee12cba371076","unresolved":false,"context_lines":[{"line_number":11,"context_line":"# implied."},{"line_number":12,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":13,"context_line":"# limitations under the License."},{"line_number":14,"context_line":"\"\"\"Riak storage controller for the queues ctlg."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Serves to construct an association between a project + queue -\u003e shard"},{"line_number":17,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_9fdff30c","line":14,"updated":"2014-06-03 14:10:55.000000000","message":"Hey Prashanth, Could you change this to redis?","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":13,"context_line":"# limitations under the License."},{"line_number":14,"context_line":"\"\"\"Redis storage controller for the queues ctlg."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Serves to construct an association between a project + queue -\u003e shard"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"    Tracked shard ctlgs:"},{"line_number":19,"context_line":"    ------------------------"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_57584b57","line":16,"updated":"2014-06-24 06:11:49.000000000","message":"Shard concept had been changed to pool","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        \"\"\""},{"line_number":71,"context_line":"        raise NotImplementedError"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def insert(self, project, queue, shard):"},{"line_number":74,"context_line":"        \"\"\"Creates a new catalogue entry, or updates it if it already existed."},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        :param project: str - Namespace to insert the given queue into"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_f70f9737","line":73,"updated":"2014-06-24 06:11:49.000000000","message":"shard to pool\n\nand also the following method","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":23,"context_line":"    ---------------------"},{"line_number":24,"context_line":"    Id                                     Value"},{"line_number":25,"context_line":"    --------------------------------------------------"},{"line_number":26,"context_line":"    \u0027project_queue_ctlg\u0027   -\u003e             \u0027pool\u0027"},{"line_number":27,"context_line":"\"\"\""},{"line_number":28,"context_line":"from marconi.queues.storage import base"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_ac8849c7","line":26,"updated":"2014-07-10 10:27:09.000000000","message":"(NIT): how about just using \u0027project_queue\u0027 to keep consistent with the other drivers?","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"}],"marconi/queues/storage/redis/claims.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class ClaimController(storage.Claim):"},{"line_number":25,"context_line":"    \"\"\"Implements claim resource operations using Riak."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    Redis Data Structures:"},{"line_number":28,"context_line":"    ---------------------"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_1a1c1e77","line":25,"updated":"2014-06-17 05:26:01.000000000","message":"Riak -\u003e Redis","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"1c0a95d9a73e5ccfc1ec6b1c439fd6b21aaf958c","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self.message_ctrl \u003d self.driver.message_controller"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _exists(self, queue, claim_id, project):"},{"line_number":62,"context_line":"        # Note : Handle expired claims here."},{"line_number":63,"context_line":"        client \u003d self._client"},{"line_number":64,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":65,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_fba67953","line":62,"updated":"2014-07-30 20:42:36.000000000","message":"NIT: add your name for future reference. NOTE(prashanth) ...\nThis should be done in most relevant comments if possible :)","commit_id":"e6ff4a5b5e5b3483826cb9b473b7ea77fc7999c8"}],"marconi/queues/storage/redis/controllers.py":[{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":23,"context_line":"MessageController \u003d messages.MessageController"},{"line_number":24,"context_line":"ClaimController \u003d claims.ClaimController"},{"line_number":25,"context_line":"CatalogueController \u003d catalogue.CatalogueController"},{"line_number":26,"context_line":"ShardsController \u003d shards.ShardsController"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_f21de563","line":26,"updated":"2014-06-24 06:11:49.000000000","message":"ShardsController to PoolsController","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"}],"marconi/queues/storage/redis/driver.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _get_redis_client(conf):"},{"line_number":27,"context_line":"    # NOTE:prashanthr_ : Check if SSL support is required."},{"line_number":28,"context_line":"    if conf.useSocketPath:"},{"line_number":29,"context_line":"        return redis.StrictRedis(unix_socket_path\u003dconf.sockPath)"},{"line_number":30,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_3d08f427","line":27,"updated":"2014-06-17 05:26:01.000000000","message":"NOTE:prashanthr_ -\u003e NOTE(prashanthr_)\n\nCould you change as suggested above. That\u0027s the preferred syntax for NOTE/BUG comments, and keeping it consistent helps to grep for them later.","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def _get_redis_client(conf):"},{"line_number":27,"context_line":"    # NOTE:prashanthr_ : Check if SSL support is required."},{"line_number":28,"context_line":"    if conf.useSocketPath:"},{"line_number":29,"context_line":"        return redis.StrictRedis(unix_socket_path\u003dconf.sockPath)"},{"line_number":30,"context_line":"    else:"},{"line_number":31,"context_line":"        host, port \u003d utils.get_hostport(conf[\u0027uri\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_5d0dc036","line":28,"updated":"2014-06-17 05:26:01.000000000","message":"conf.useSocketPath -\u003e conf.use_socket_path","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from marconi.queues.storage.redis import controllers"},{"line_number":19,"context_line":"from marconi.queues.storage.redis import options"},{"line_number":20,"context_line":"from marconi.queues.storage.redis import utils"},{"line_number":21,"context_line":"import redis"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_f2540500","line":21,"updated":"2014-06-24 06:11:49.000000000","message":"import order should be \n\nbuild-in\n\nthird-party\n\napplication","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":8092,"name":"Sriram Madapusi Vasudevan","email":"sriram1991mv@gmail.com","username":"thesriram"},"change_message_id":"a666cdbe8c42d8b96e27485ace1d5763a6555e4f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def _get_redis_client(conf):"},{"line_number":29,"context_line":"    # NOTE(prashanthr_): Check if SSL support is required."},{"line_number":30,"context_line":"    if conf.use_socket_path:"},{"line_number":31,"context_line":"        return redis.StrictRedis(unix_socket_path\u003dconf.sock_path)"},{"line_number":32,"context_line":"    else:"},{"line_number":33,"context_line":"        host, port \u003d utils.get_hostport(conf[\u0027uri\u0027])"},{"line_number":34,"context_line":"        return redis.StrictRedis(host\u003dhost, port\u003dport, db\u003dconf.database)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c673234c","line":31,"updated":"2014-07-21 15:09:46.000000000","message":"Q: do we want to use a pooled connection from redis?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def _get_redis_client(conf):"},{"line_number":29,"context_line":"    # NOTE(prashanthr_): Check if SSL support is required."},{"line_number":30,"context_line":"    if conf.use_socket_path:"},{"line_number":31,"context_line":"        return redis.StrictRedis(unix_socket_path\u003dconf.sock_path)"},{"line_number":32,"context_line":"    else:"},{"line_number":33,"context_line":"        host, port \u003d utils.get_hostport(conf[\u0027uri\u0027])"},{"line_number":34,"context_line":"        return redis.StrictRedis(host\u003dhost, port\u003dport, db\u003dconf.database)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_62906343","line":31,"in_reply_to":"baada198_c673234c","updated":"2014-07-23 13:20:33.000000000","message":"Hi Sriram,\n\nhttps://github.com/andymccurdy/redis-py/blob/master/redis/client.py#L444\n\nFrom this i understood that a connection pool is created by default when we do not specify one. Should I create a new one with a fixed number of connections ?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":28,"context_line":"def _get_redis_client(conf):"},{"line_number":29,"context_line":"    # NOTE(prashanthr_): Check if SSL support is required."},{"line_number":30,"context_line":"    if conf.use_socket_path:"},{"line_number":31,"context_line":"        return redis.StrictRedis(unix_socket_path\u003dconf.sock_path)"},{"line_number":32,"context_line":"    else:"},{"line_number":33,"context_line":"        host, port \u003d utils.get_hostport(conf[\u0027uri\u0027])"},{"line_number":34,"context_line":"        return redis.StrictRedis(host\u003dhost, port\u003dport, db\u003dconf.database)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_51004fab","line":31,"in_reply_to":"baada198_c673234c","updated":"2014-07-22 23:30:09.000000000","message":"I think it is OK as-is, since if you don\u0027t specify a pool, one is created automatically. We are only instantiating a single StrictRedis instance, so all requests will use the same pool.\n\nSee also: https://github.com/andymccurdy/redis-py#connection-pools\n\nThat being said, we should add support for async io via trollius at some point. Apparently that is possible by subclassing the Connection class:\n\nhttps://github.com/andymccurdy/redis-py#connections","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"1c0a95d9a73e5ccfc1ec6b1c439fd6b21aaf958c","unresolved":false,"context_lines":[{"line_number":14,"context_line":"try:"},{"line_number":15,"context_line":"    import urlparse"},{"line_number":16,"context_line":"except ImportError:"},{"line_number":17,"context_line":"    import urllib as urlparse"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"import redis"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_e6b50033","line":17,"updated":"2014-07-30 20:42:36.000000000","message":"Why not to use urllib directly? If there is a performance reason, we could consider adding urlparse to the requirements.","commit_id":"e6ff4a5b5e5b3483826cb9b473b7ea77fc7999c8"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def _get_redis_client(conf):"},{"line_number":33,"context_line":"    # NOTE(prashanthr_): Check if SSL support is required."},{"line_number":34,"context_line":"    if six.PY2:"},{"line_number":35,"context_line":"        parsed_url \u003d urlparse.urlparse(conf.uri)"},{"line_number":36,"context_line":"    elif six.PY3:"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_62eb6add","line":33,"updated":"2014-08-01 00:06:41.000000000","message":"STYLE: Should this be a TODO instead of a NOTE?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def _get_redis_client(conf):"},{"line_number":33,"context_line":"    # NOTE(prashanthr_): Check if SSL support is required."},{"line_number":34,"context_line":"    if six.PY2:"},{"line_number":35,"context_line":"        parsed_url \u003d urlparse.urlparse(conf.uri)"},{"line_number":36,"context_line":"    elif six.PY3:"},{"line_number":37,"context_line":"        parsed_url \u003d urlparse.parse.urlparse(conf.uri)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_a2b822e9","line":34,"updated":"2014-08-01 00:06:41.000000000","message":"NIT: I think you can use six.moves to avoid explicitly having to check python version...","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        return redis.StrictRedis(host\u003dparsed_url.hostname,"},{"line_number":41,"context_line":"                                 port\u003dparsed_url.port)"},{"line_number":42,"context_line":"    else:"},{"line_number":43,"context_line":"        return redis.StrictRedis(unix_socket_path\u003dparsed_url.path)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"class DataDriver(storage.DataDriverBase):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_7d878b5b","line":43,"updated":"2014-08-01 00:06:41.000000000","message":"TEST: We need a way to test this code path. I want to be sure that the string provided as an example in the config help text works. I don\u0027t know that we can get redis listening on a unix socket in the gate, but perhaps we can mock redis.StrictRedis and just be sure it received the correct value for the \"unix_socket_path\" kwarg.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"}],"marconi/queues/storage/redis/messages.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _get_count(self, messages_set_id):"},{"line_number":69,"context_line":"        # Return the number of messages in a queue scoped by"},{"line_number":70,"context_line":"        # queue and project."},{"line_number":71,"context_line":"        return self._client.zcard(messages_set_id)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_fd4bec5c","line":70,"updated":"2014-06-17 05:26:01.000000000","message":"This looks like it should be a docstring. Could you make it so? :)\n\n    \"\"\"\n    Return the number of messages in a queue scoped by queue and project.\n    \"\"\"\n\nerror: docstring","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def _delete_queue_messages(self, queue, project):"},{"line_number":77,"context_line":"        # Method to remove all the messages belonging to an"},{"line_number":78,"context_line":"        # individual queue. Will be referenced from the"},{"line_number":79,"context_line":"        # QueueController."},{"line_number":80,"context_line":"        client \u003d self._client"},{"line_number":81,"context_line":"        pipe \u003d self._pipeline"},{"line_number":82,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue, project,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_1d51780e","line":79,"updated":"2014-06-17 05:26:01.000000000","message":"error: docstring","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":92,"context_line":"    def _exists(self, queue, project, key):"},{"line_number":93,"context_line":"        # Helper function which checks if a particular message_id"},{"line_number":94,"context_line":"        # exists in the sorted set of the queues message ids."},{"line_number":95,"context_line":"        # Note(prashanthr_): Operation of the order of O(n)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue, project,"},{"line_number":98,"context_line":"                                                   QUEUE_MESSAGES_LIST_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_7d3fdcb5","line":95,"updated":"2014-06-17 05:26:01.000000000","message":"error: docstring","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def _get_first_message_id(self, queue, project, sort):"},{"line_number":103,"context_line":"        # Helper function to get the first message in the queue"},{"line_number":104,"context_line":"        # sort \u003e 0 get from the left else from the right."},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue, project,"},{"line_number":107,"context_line":"                                                   QUEUE_MESSAGES_LIST_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_9d3ca8c1","line":104,"updated":"2014-06-17 05:26:01.000000000","message":"error: docstring","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        if sort \u003e 0:"},{"line_number":110,"context_line":"            return self._client.zrange(messages_set_id, 0, 0)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        return self._client.zrevrange(messages_set_id, 0, 0)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _get(self, message_id):"},{"line_number":115,"context_line":"        return self._client.hgetall(message_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_5da940de","line":112,"updated":"2014-06-17 05:26:01.000000000","message":"You can replace this with a cleaner idiom:\n\n    sorter \u003d self._client.zrange if sort \u003e 0 else self._client.zrevrange\n    return sorter(messages_set_id, 0, 0)","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    @utils.retries_on_autoreconnect"},{"line_number":201,"context_line":"    def bulk_get(self, queue, message_ids, project\u003dNone):"},{"line_number":202,"context_line":"        # TODO(prashanthr_): Pipeline is not used here as atomic guarentee"},{"line_number":203,"context_line":"        # is not required.but can be used for performance."},{"line_number":204,"context_line":"        client \u003d self._client"},{"line_number":205,"context_line":"        if not self._queue_controller.exists(queue, project):"},{"line_number":206,"context_line":"                raise errors.QueueDoesNotExist(queue,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_9d91089d","line":203,"updated":"2014-06-17 05:26:01.000000000","message":"guarentee -\u003e guarantee\n\nrequired.but -\u003e required, but","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        self._pipeline.delete(message_id).\\"},{"line_number":290,"context_line":"            zrem(messages_set_id, message_id).\\"},{"line_number":291,"context_line":"            execute()"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    @utils.raises_conn_error"},{"line_number":294,"context_line":"    @utils.retries_on_autoreconnect"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_1d3b389d","line":291,"updated":"2014-06-17 05:26:01.000000000","message":"To avoid the use of \u0027\\\u0027, how about?:\n\n    pipe \u003d self._pipeline\n    ...\n    pipe.delete(message_id).zrem(messages_set_id, message_id).execute()\n\nThat should keep it at about 75 characters in one column. What do you think? :)","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from marconi.queues import storage"},{"line_number":20,"context_line":"from marconi.queues.storage import errors"},{"line_number":21,"context_line":"from marconi.queues.storage.redis import utils"},{"line_number":22,"context_line":"import six"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"QUEUE_MESSAGES_LIST_SUFFIX \u003d \u0027messages\u0027"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_725f1510","line":22,"updated":"2014-06-24 06:11:49.000000000","message":"import order","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":144,"context_line":"                                                   QUEUE_MESSAGES_LIST_SUFFIX)"},{"line_number":145,"context_line":"        client \u003d self._client"},{"line_number":146,"context_line":"        start \u003d client.zrank(messages_set_id, marker) or 0"},{"line_number":147,"context_line":"        # In a sharded context, the default values are not being set."},{"line_number":148,"context_line":"        limit \u003d limit or storage.DEFAULT_MESSAGES_PER_CLAIM"},{"line_number":149,"context_line":"        message_ids \u003d client.zrange(messages_set_id, start, start+limit)"},{"line_number":150,"context_line":"        filters \u003d collections.defaultdict(dict)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_279b72ca","line":147,"updated":"2014-07-10 10:27:09.000000000","message":"We\u0027re using pool now.","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"4613d1a7e7fc1f7c311a256bcea9e3a9b677de93","unresolved":false,"context_lines":[{"line_number":144,"context_line":"                                                   QUEUE_MESSAGES_LIST_SUFFIX)"},{"line_number":145,"context_line":"        client \u003d self._client"},{"line_number":146,"context_line":"        start \u003d client.zrank(messages_set_id, marker) or 0"},{"line_number":147,"context_line":"        # In a sharded context, the default values are not being set."},{"line_number":148,"context_line":"        limit \u003d limit or storage.DEFAULT_MESSAGES_PER_CLAIM"},{"line_number":149,"context_line":"        message_ids \u003d client.zrange(messages_set_id, start, start+limit)"},{"line_number":150,"context_line":"        filters \u003d collections.defaultdict(dict)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_777c2321","line":147,"in_reply_to":"baada198_279b72ca","updated":"2014-07-10 19:23:42.000000000","message":"\u0027sharded context\u0027 -\u003e \u0027pooled context\u0027, as Fei recommends.","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"b2cabef8797da2c3b2c4629c96977c5ca8cc59f9","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                                                   QUEUE_MESSAGES_LIST_SUFFIX)"},{"line_number":144,"context_line":"        client \u003d self._client"},{"line_number":145,"context_line":"        start \u003d client.zrank(messages_set_id, marker) or 0"},{"line_number":146,"context_line":"        # In a pooled environment, the default values are not being set."},{"line_number":147,"context_line":"        limit \u003d limit or storage.DEFAULT_MESSAGES_PER_CLAIM"},{"line_number":148,"context_line":"        message_ids \u003d client.zrange(messages_set_id, start, start+limit)"},{"line_number":149,"context_line":"        filters \u003d collections.defaultdict(dict)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_afc5bf3e","line":146,"updated":"2014-07-16 16:50:03.000000000","message":"this should be fixed now, thus you should not do it there.","commit_id":"6d294cfe349da72d0b2d9ee6df97540bd3d74501"},{"author":{"_account_id":7498,"name":"Malini Kamalambal","email":"malini.kamalambal@rackspace.com","username":"malini-pk"},"change_message_id":"4d5547cd88fa071f6bef0953f851d6fbff3627bd","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                raise errors.MessageIsClaimed(message_id)"},{"line_number":296,"context_line":"        else:"},{"line_number":297,"context_line":"            if msg_claim !\u003d claim:"},{"line_number":298,"context_line":"                raise errors.MessageIsClaimedBy(message_id, msg_claim)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        pipe.delete(message_id).zrem(messages_set_id, message_id).execute()"},{"line_number":301,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_2699dc1f","line":298,"updated":"2014-07-16 16:07:36.000000000","message":"We probably want to print out the claim id passed in by the request, instead of the msg_claim","commit_id":"6d294cfe349da72d0b2d9ee6df97540bd3d74501"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"02f2e29eaa949932d711f00f0195b243704bcf6c","unresolved":false,"context_lines":[{"line_number":123,"context_line":"    def _get(self, message_id):"},{"line_number":124,"context_line":"        return self._client.hgetall(message_id)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":127,"context_line":"        super(MessageController, self).__init__(*args, **kwargs)"},{"line_number":128,"context_line":"        self.init_connection()"},{"line_number":129,"context_line":"        self._init_pipeline()"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_6ad22301","line":126,"updated":"2014-07-21 12:30:06.000000000","message":"nit: could you move __init__ at top of the class? there is no convention about this, but it improves readability a bit","commit_id":"bc0acaae4844f90e419beeb1a15d3e8a227b6226"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    Redis Data Structures:"},{"line_number":35,"context_line":"    ---------------------"},{"line_number":36,"context_line":"    Messages list ( Redis Sorted Set ) contains message ids"},{"line_number":37,"context_line":"    sorted by timestamp."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    scope: \u003cproject-id.q-name\u003e"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_49426369","line":37,"updated":"2014-07-22 23:30:09.000000000","message":"BUG/DSQ: I think this is going to cause a problem when you have lots of concurrent requests to insert messages; in that case, you have the risk of ending up in one or both of the following situations:\n\nA. Multiple messages receiving identical timestamps. In this case, ZRANGE sorts lexicographically, so you get things ordered (essentially randomly) by UUID.\n\nB. Messages being inserted in the reverse order from the timestamp. This can happen because there is no atomicity (in the current code) around getting the current timestamp and subsequently creating the new message record with that timestamp. This situation can cause a client to miss a message if it performs a query at precisely the wrong moment; the client can get a UUID marker for the record with the later timestamp in it\u0027s \"next\" href, such that when it next queries for messages, it will never see the other message that has the earlier timestamp.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    Redis Data Structures:"},{"line_number":35,"context_line":"    ---------------------"},{"line_number":36,"context_line":"    Messages list ( Redis Sorted Set ) contains message ids"},{"line_number":37,"context_line":"    sorted by timestamp."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    scope: \u003cproject-id.q-name\u003e"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a3c5d35d","line":37,"in_reply_to":"baada198_49426369","updated":"2014-07-23 13:20:33.000000000","message":"I think I need some suggestions on this. The immediate thing that comes to my mind is to have atomicity enforced during message creation at queue level.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def _init_pipeline(self):"},{"line_number":61,"context_line":"        self._pipeline \u003d self._client.pipeline()"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def init_connection(self):"},{"line_number":64,"context_line":"        \"\"\"Will be used during reconnection attempts."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_143c0530","line":63,"updated":"2014-07-22 23:30:09.000000000","message":"Q. Why is this a public method? I this is used for reconnection attempts, it should come from the driver directly, not be directed through MessageController, because MessageController is at equal level to others...","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    def _init_pipeline(self):"},{"line_number":61,"context_line":"        self._pipeline \u003d self._client.pipeline()"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def init_connection(self):"},{"line_number":64,"context_line":"        \"\"\"Will be used during reconnection attempts."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e628b9f0","line":63,"in_reply_to":"baada198_143c0530","updated":"2014-07-23 13:20:33.000000000","message":"I have added this at the driver level. \nThanks for pointing this out :)","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def init_connection(self):"},{"line_number":64,"context_line":"        \"\"\"Will be used during reconnection attempts."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        \"\"\""},{"line_number":67,"context_line":"        self._client \u003d self.driver.connection"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_14ffa536","line":65,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Remove blank line from docstring","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    def _get_count(self, messages_set_id):"},{"line_number":78,"context_line":"        \"\"\"Get num messages in a Queue."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"           Return the number of messages in a queue scoped by"},{"line_number":81,"context_line":"           queue and project."},{"line_number":82,"context_line":"        \"\"\""},{"line_number":83,"context_line":"        return self._client.zcard(messages_set_id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_9447357a","line":80,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Do not indent description, instead left-aligning with first double-quote character:\n\n    \"\"\"Get num messages in a Queue. \n\n    Return the number of messages in a queue scoped by\n    queue and project.\n    \"\"\"","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def _delete_queue_messages(self, queue, project):"},{"line_number":89,"context_line":"        \"\"\"Method to remove all the messages belonging to an individual queue."},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"           Will be referenced from the QueueController."},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        client \u003d self._client"},{"line_number":94,"context_line":"        pipe \u003d self._pipeline"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_d438cdf0","line":91,"updated":"2014-07-22 23:30:09.000000000","message":"See comment above.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        for msg_id in message_ids:"},{"line_number":101,"context_line":"            pipe.delete(msg_id)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        pipe.execute()"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def _exists(self, queue, project, key):"},{"line_number":106,"context_line":"        \"\"\"Check if message exists in the Queue."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e9b89713","line":103,"updated":"2014-07-22 23:30:09.000000000","message":"DSQ: Seems like pipe should not be executed by this helper method, in case the caller wants to add additional steps. In fact, I think that although behind the scenes, everyone is sharing the same instance of pipe, it would be clearer and more obvious what is going on, if _delete_queue_messages took a \"pipe\" param and used that instead of looking up the pipe from self._client.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"20357cc37a33d6fd644bf4c89fb3a6e2fed2ef42","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        for msg_id in message_ids:"},{"line_number":101,"context_line":"            pipe.delete(msg_id)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        pipe.execute()"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def _exists(self, queue, project, key):"},{"line_number":106,"context_line":"        \"\"\"Check if message exists in the Queue."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_870a7e1e","line":103,"in_reply_to":"baada198_e9b89713","updated":"2014-07-29 01:51:13.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        for msg_id in message_ids:"},{"line_number":101,"context_line":"            pipe.delete(msg_id)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        pipe.execute()"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def _exists(self, queue, project, key):"},{"line_number":106,"context_line":"        \"\"\"Check if message exists in the Queue."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_23e543dc","line":103,"in_reply_to":"baada198_e9b89713","updated":"2014-07-23 13:20:33.000000000","message":"Thanks a lot for this suggestion:) Makes a whole lot of sense.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    def _exists(self, queue, project, key):"},{"line_number":106,"context_line":"        \"\"\"Check if message exists in the Queue."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            Helper function which checks if a particular message_id"},{"line_number":109,"context_line":"            exists in the sorted set of the queues message ids."},{"line_number":110,"context_line":"            Note(prashanthr_): Operation of the order of O(n)"},{"line_number":111,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_f43dd1de","line":108,"updated":"2014-07-22 23:30:09.000000000","message":"See comment above","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    def _exists(self, queue, project, key):"},{"line_number":106,"context_line":"        \"\"\"Check if message exists in the Queue."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"            Helper function which checks if a particular message_id"},{"line_number":109,"context_line":"            exists in the sorted set of the queues message ids."},{"line_number":110,"context_line":"            Note(prashanthr_): Operation of the order of O(n)"},{"line_number":111,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c67bb5bc","line":108,"in_reply_to":"baada198_f43dd1de","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    def _get_first_message_id(self, queue, project, sort):"},{"line_number":118,"context_line":"        \"\"\"Fetch head/tail of the Queue."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"           Helper function to get the first message in the queue"},{"line_number":121,"context_line":"           sort \u003e 0 get from the left else from the right."},{"line_number":122,"context_line":"        \"\"\""},{"line_number":123,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue, project,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_542cbdac","line":120,"updated":"2014-07-22 23:30:09.000000000","message":"See comment above.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    def _get_first_message_id(self, queue, project, sort):"},{"line_number":118,"context_line":"        \"\"\"Fetch head/tail of the Queue."},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"           Helper function to get the first message in the queue"},{"line_number":121,"context_line":"           sort \u003e 0 get from the left else from the right."},{"line_number":122,"context_line":"        \"\"\""},{"line_number":123,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue, project,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e647d978","line":120,"in_reply_to":"baada198_542cbdac","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    def _get(self, message_id):"},{"line_number":130,"context_line":"        return self._client.hgetall(message_id)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def list(self, queue, project\u003dNone, marker\u003dNone,"},{"line_number":133,"context_line":"             limit\u003dstorage.DEFAULT_MESSAGES_PER_PAGE,"},{"line_number":134,"context_line":"             echo\u003dTrue, client_uuid\u003dNone,"},{"line_number":135,"context_line":"             include_claimed\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_69d487bd","line":132,"updated":"2014-07-22 23:30:09.000000000","message":"Q. I didn\u0027t see anywhere that expired messages are being filtered? Also, what is the plan for culling expired messages from the DB?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":129,"context_line":"    def _get(self, message_id):"},{"line_number":130,"context_line":"        return self._client.hgetall(message_id)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def list(self, queue, project\u003dNone, marker\u003dNone,"},{"line_number":133,"context_line":"             limit\u003dstorage.DEFAULT_MESSAGES_PER_PAGE,"},{"line_number":134,"context_line":"             echo\u003dTrue, client_uuid\u003dNone,"},{"line_number":135,"context_line":"             include_claimed\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e17183ac","line":132,"in_reply_to":"baada198_69d487bd","updated":"2014-07-23 13:20:33.000000000","message":"kgriffs: I will need to add the filter. Will do it.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        client \u003d self._client"},{"line_number":145,"context_line":"        start \u003d client.zrank(messages_set_id, marker) or 0"},{"line_number":146,"context_line":"        message_ids \u003d client.zrange(messages_set_id, start, start+limit)"},{"line_number":147,"context_line":"        filters \u003d collections.defaultdict(dict)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        # Build a list of filters for checking the following:"},{"line_number":150,"context_line":"        # 1. Message is claimed."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_aab3f4ea","line":147,"updated":"2014-07-22 23:30:09.000000000","message":"KISS: What do you think about simply using a list of filters instead of a dict?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        client \u003d self._client"},{"line_number":145,"context_line":"        start \u003d client.zrank(messages_set_id, marker) or 0"},{"line_number":146,"context_line":"        message_ids \u003d client.zrange(messages_set_id, start, start+limit)"},{"line_number":147,"context_line":"        filters \u003d collections.defaultdict(dict)"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"        # Build a list of filters for checking the following:"},{"line_number":150,"context_line":"        # 1. Message is claimed."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_61dad37a","line":147,"in_reply_to":"baada198_aab3f4ea","updated":"2014-07-23 13:20:33.000000000","message":"I thought that the dict pattern was very convenient here, where I could store \nfilter[\u0027name\u0027][\u0027function(f)\u0027]\u003dfunction\nfilter[\u0027name\u0027][\u0027value(v)\u0027]\u003d value\n\nI can use a named tuple here and make a list of such named tuples for filtering.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        # 1. Message is claimed."},{"line_number":151,"context_line":"        # 2. echo message to the client."},{"line_number":152,"context_line":"        if not include_claimed:"},{"line_number":153,"context_line":"            filters[\u0027claimed_filter\u0027][\u0027f\u0027] \u003d utils.msg_claimed_filter"},{"line_number":154,"context_line":"            filters[\u0027claimed_filter\u0027][\u0027f.v\u0027] \u003d timeutils.utcnow_ts()"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        if not echo:"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_8ae1d02c","line":153,"updated":"2014-07-22 23:30:09.000000000","message":"PERF: What do you think about simply assigning \u0027claimed_filter\u0027 to a dict? This would remove the need to use collections.defaultdict, which is slower than using the basic dict type. E.g.,:\n\n    filters[\u0027claimed_filter\u0027] \u003d {\n        \u0027f\u0027: utils.msg_claimed_filter,\n        \u0027f.v\u0027: timeutils.utcnow_ts(),\n    }\n\nOr, even more performant, you could simply assign a tuple:\n\n    filters[\u0027claimed_filter\u0027] \u003d (\n        utils.msg_claimed_filter,\n        timeutils.utcnow_ts(),\n    )","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            filters[\u0027claimed_filter\u0027][\u0027f.v\u0027] \u003d timeutils.utcnow_ts()"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        if not echo:"},{"line_number":157,"context_line":"            filters[\u0027echo_filter\u0027][\u0027f\u0027] \u003d utils.msg_echo_filter"},{"line_number":158,"context_line":"            filters[\u0027echo_filter\u0027][\u0027f.v\u0027] \u003d client_uuid"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        marker \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2ac1a481","line":157,"updated":"2014-07-22 23:30:09.000000000","message":"DRY/STYLE: The \u0027_filter\u0027 postfix is redundant, as it can be inferred from the name of the dict, \"filters\".","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":154,"context_line":"            filters[\u0027claimed_filter\u0027][\u0027f.v\u0027] \u003d timeutils.utcnow_ts()"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"        if not echo:"},{"line_number":157,"context_line":"            filters[\u0027echo_filter\u0027][\u0027f\u0027] \u003d utils.msg_echo_filter"},{"line_number":158,"context_line":"            filters[\u0027echo_filter\u0027][\u0027f.v\u0027] \u003d client_uuid"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        marker \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_21fc5b72","line":157,"in_reply_to":"baada198_2ac1a481","updated":"2014-07-23 13:20:33.000000000","message":"I have remove the postfix.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        marker \u003d {}"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        def _it(message_ids, filters\u003d{}):"},{"line_number":163,"context_line":"            \"\"\"Create a filtered iterator of messages."},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"                The function accepts a list of filters to be filtered"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2ae4440d","line":162,"updated":"2014-07-22 23:30:09.000000000","message":"PERF: I\u0027m concerned that we are filtering messages on the web head vs. in the DB server itself. Is there a way that we can have Redis give us an array/list of messages that are already filtered? Perhaps with a Lua script?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        marker \u003d {}"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        def _it(message_ids, filters\u003d{}):"},{"line_number":163,"context_line":"            \"\"\"Create a filtered iterator of messages."},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"                The function accepts a list of filters to be filtered"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e128a3f0","line":162,"in_reply_to":"baada198_2ae4440d","updated":"2014-07-23 13:20:33.000000000","message":"kgriffs: we can use the lua script but i am just concerned about how to store the lua scripts and test them ?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        def _it(message_ids, filters\u003d{}):"},{"line_number":163,"context_line":"            \"\"\"Create a filtered iterator of messages."},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"                The function accepts a list of filters to be filtered"},{"line_number":166,"context_line":"                before the the message can be included as a part of the reply."},{"line_number":167,"context_line":"            \"\"\""},{"line_number":168,"context_line":"            now \u003d timeutils.utcnow_ts()"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0f479278","line":165,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description in docstring","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            now \u003d timeutils.utcnow_ts()"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"            for message_id in message_ids:"},{"line_number":171,"context_line":"                message \u003d client.hgetall(message_id)"},{"line_number":172,"context_line":"                if message:"},{"line_number":173,"context_line":"                    for filter in six.itervalues(filters):"},{"line_number":174,"context_line":"                        filter_func \u003d filter[\u0027f\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_65902dee","line":171,"updated":"2014-07-22 23:30:09.000000000","message":"PERF: What do you think about pipelining these calls, so that we get all the messages in a single request?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            now \u003d timeutils.utcnow_ts()"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"            for message_id in message_ids:"},{"line_number":171,"context_line":"                message \u003d client.hgetall(message_id)"},{"line_number":172,"context_line":"                if message:"},{"line_number":173,"context_line":"                    for filter in six.itervalues(filters):"},{"line_number":174,"context_line":"                        filter_func \u003d filter[\u0027f\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_014d9799","line":171,"in_reply_to":"baada198_65902dee","updated":"2014-07-23 13:20:33.000000000","message":"Great idea :) I have done that now.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":208,"context_line":"    @utils.raises_conn_error"},{"line_number":209,"context_line":"    @utils.retries_on_autoreconnect"},{"line_number":210,"context_line":"    def bulk_get(self, queue, message_ids, project\u003dNone):"},{"line_number":211,"context_line":"        # Note(prashanthr_): Pipeline is not used here as atomic guarantee"},{"line_number":212,"context_line":"        # is not required, but can be used for performance."},{"line_number":213,"context_line":"        client \u003d self._client"},{"line_number":214,"context_line":"        if not self._queue_controller.exists(queue, project):"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_45f2499c","line":211,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: \"Note\" should be written in all-caps","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            {"},{"line_number":245,"context_line":"                \u0027id\u0027: utils.generate_uuid(),"},{"line_number":246,"context_line":"                \u0027t\u0027: message[\u0027ttl\u0027],"},{"line_number":247,"context_line":"                \u0027e\u0027: now_dt + datetime.timedelta(seconds\u003dmessage[\u0027ttl\u0027]),"},{"line_number":248,"context_line":"                \u0027u\u0027: client_uuid,"},{"line_number":249,"context_line":"                \u0027c\u0027: None,"},{"line_number":250,"context_line":"                \u0027k\u0027: num_messages + index,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_40d7974f","line":247,"updated":"2014-07-22 23:30:09.000000000","message":"PERF/KISS: Can this simply be set to (now + message[\u0027ttl\u0027])?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                \u0027c\u0027: None,"},{"line_number":250,"context_line":"                \u0027k\u0027: num_messages + index,"},{"line_number":251,"context_line":"                \u0027c.e\u0027: now,"},{"line_number":252,"context_line":"                \u0027b\u0027: message[\u0027body\u0027] if \u0027body\u0027 in message else {},"},{"line_number":253,"context_line":"            }"},{"line_number":254,"context_line":"            for index, message in enumerate(messages)"},{"line_number":255,"context_line":"        ]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2079c330","line":252,"updated":"2014-07-22 23:30:09.000000000","message":"FYI: I think we had better msgpack the body. This can be a separate patch. \n\nSee also: https://blueprints.launchpad.net/marconi/+spec/store-messages-as-binary","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                \u0027c\u0027: None,"},{"line_number":250,"context_line":"                \u0027k\u0027: num_messages + index,"},{"line_number":251,"context_line":"                \u0027c.e\u0027: now,"},{"line_number":252,"context_line":"                \u0027b\u0027: message[\u0027body\u0027] if \u0027body\u0027 in message else {},"},{"line_number":253,"context_line":"            }"},{"line_number":254,"context_line":"            for index, message in enumerate(messages)"},{"line_number":255,"context_line":"        ]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_1cf17c01","line":252,"in_reply_to":"baada198_2079c330","updated":"2014-07-23 13:20:33.000000000","message":"I shall keep a note of this in my list of \"post merged work\" checklist.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        ]"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        pipe \u003d self._pipeline"},{"line_number":258,"context_line":"        self._queue_controller._inc_counter(queue, project, len(messages))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        for message in prepared_messages:"},{"line_number":261,"context_line":"            m_id \u003d message[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_4980a3f7","line":258,"updated":"2014-07-22 23:30:09.000000000","message":"BUG: I believe there is a race condition here, since _inc_counter is not using the pipe. Can we pass pipe to _inc_counter?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        ]"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        pipe \u003d self._pipeline"},{"line_number":258,"context_line":"        self._queue_controller._inc_counter(queue, project, len(messages))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        for message in prepared_messages:"},{"line_number":261,"context_line":"            m_id \u003d message[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_57090d31","line":258,"in_reply_to":"baada198_4980a3f7","updated":"2014-07-23 13:20:33.000000000","message":"I believe we cannot use the pipe here because we need a get and a set operation. SO i thought of using a lock here instead.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        self._queue_controller._inc_counter(queue, project, len(messages))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        for message in prepared_messages:"},{"line_number":261,"context_line":"            m_id \u003d message[\u0027id\u0027]"},{"line_number":262,"context_line":"            message_ids.append(m_id)"},{"line_number":263,"context_line":"            pipe.zadd(messages_set_id, message[\u0027c.e\u0027], m_id)"},{"line_number":264,"context_line":"            pipe.hmset(m_id, message)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a05b13f8","line":261,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Avoid the use of single-character abbreviations","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"20357cc37a33d6fd644bf4c89fb3a6e2fed2ef42","unresolved":false,"context_lines":[{"line_number":258,"context_line":"        self._queue_controller._inc_counter(queue, project, len(messages))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"        for message in prepared_messages:"},{"line_number":261,"context_line":"            m_id \u003d message[\u0027id\u0027]"},{"line_number":262,"context_line":"            message_ids.append(m_id)"},{"line_number":263,"context_line":"            pipe.zadd(messages_set_id, message[\u0027c.e\u0027], m_id)"},{"line_number":264,"context_line":"            pipe.hmset(m_id, message)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_b7ab1b74","line":261,"in_reply_to":"baada198_a05b13f8","updated":"2014-07-29 01:51:13.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        for message in prepared_messages:"},{"line_number":261,"context_line":"            m_id \u003d message[\u0027id\u0027]"},{"line_number":262,"context_line":"            message_ids.append(m_id)"},{"line_number":263,"context_line":"            pipe.zadd(messages_set_id, message[\u0027c.e\u0027], m_id)"},{"line_number":264,"context_line":"            pipe.hmset(m_id, message)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        pipe.execute()"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c02d67ff","line":263,"updated":"2014-07-22 23:30:09.000000000","message":"NIT: This is a little confusing, since you are overloading the \u0027c.e\u0027 field to mean \u0027message create time\u0027, when it is later used to mean \u0027claim expiration\u0027; these two values just happen to be identical at this moment. What do you think about just setting this to the \"now\" variable directly, instead?\n\nThat being said, we may have a collision problem with ordering things (see comment on class docstring)\n\nPERF: Even though pipelining is used here, you may still realize a performance gain from setting all the score:member pairs  in a single ZADD. According to the redis docs, this is possible, but idk if py-redis supports it.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        for message in prepared_messages:"},{"line_number":261,"context_line":"            m_id \u003d message[\u0027id\u0027]"},{"line_number":262,"context_line":"            message_ids.append(m_id)"},{"line_number":263,"context_line":"            pipe.zadd(messages_set_id, message[\u0027c.e\u0027], m_id)"},{"line_number":264,"context_line":"            pipe.hmset(m_id, message)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        pipe.execute()"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_d298cbce","line":263,"in_reply_to":"baada198_c02d67ff","updated":"2014-07-23 13:20:33.000000000","message":"c.e field carries no meaning when \u0027c\u0027 is None, so had set it to now. Should I remove it while creating ? If no, what should be the default value ?\n\nI shall look into the performance enhancement.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    @utils.reset_pipeline"},{"line_number":129,"context_line":"    def list(self, queue, project\u003dNone, marker\u003dNone,"},{"line_number":130,"context_line":"             limit\u003dstorage.DEFAULT_MESSAGES_PER_PAGE,"},{"line_number":131,"context_line":"             echo\u003dTrue, client_uuid\u003dNone,"},{"line_number":132,"context_line":"             include_claimed\u003dFalse):"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        if not self._queue_controller.exists(queue, project):"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_bf1dbfc0","line":131,"updated":"2014-07-31 06:36:47.000000000","message":"Q: why we default echo\u003dTrue  here ?, it\u0027s False for mongodb and sqlalchemy.","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            raise errors.MessageDoesNotExist(message_id, queue,"},{"line_number":218,"context_line":"                                             project)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        msg \u003d self._get(message_id)"},{"line_number":221,"context_line":"        return utils.basic_message(msg, timeutils.utcnow_ts())"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_3fe60fb1","line":220,"updated":"2014-07-31 06:36:47.000000000","message":"NIT: can we use the _get(mesage_id) result to check whether it exists or not?","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                                             project)"},{"line_number":329,"context_line":""},{"line_number":330,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":331,"context_line":"        message \u003d self._get(message_id)"},{"line_number":332,"context_line":"        msg_claim \u003d message[\u0027c\u0027]"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"        is_claimed \u003d (msg_claim is not \u0027None\u0027 and"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_7f5b2755","line":331,"updated":"2014-07-31 06:36:47.000000000","message":"ditto","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from marconi.queues.storage.redis import utils"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"QUEUE_MESSAGES_LIST_SUFFIX \u003d \u0027messages\u0027"},{"line_number":28,"context_line":"QUEUE_MESSAGES_INDEX_SUFFIX \u003d \u0027index\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_8226bec9","line":27,"updated":"2014-08-01 00:06:41.000000000","message":"DOC: Per my below comment on the docstring, I think the terminology here could be improved in the interest of self-documenting code. Also, I think the \"QUEUE_\" prefix is not needed since there aren\u0027t any other kind of messages, after all. :)\n\nHow about renaming to:\n\n    \tMESSAGE_IDS_SUFFIX \u003d \u0027message-ids\u0027","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"QUEUE_MESSAGES_LIST_SUFFIX \u003d \u0027messages\u0027"},{"line_number":28,"context_line":"QUEUE_MESSAGES_INDEX_SUFFIX \u003d \u0027index\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class MessageController(storage.Message):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_3c9ef954","line":28,"updated":"2014-08-01 00:06:41.000000000","message":"DOC/STYLE:  To make this more self-documenting, I think it would be better to name this something more along the lines of \u0027rank_counter\u0027. \u0027index\u0027 can be confused with the Redis item index. IIRC, you are actually creating a side counter that is used for ranking. Also, per above comment, \"QUEUES_\" prefix could be dropped, and \"MESSAGES\" could be made singular.\n\nP.S. - This side counter should be documented in the MessageController class docstring. :)","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    Redis Data Structures:"},{"line_number":37,"context_line":"    ---------------------"},{"line_number":38,"context_line":"    Messages list ( Redis Sorted Set ) contains message ids"},{"line_number":39,"context_line":"    sorted by message ids."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    scope: \u003cproject-id.q-name\u003e"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_62a44a4c","line":38,"updated":"2014-08-01 00:06:41.000000000","message":"This confused me at first... it isn\u0027t a list of messages but a set of Message IDs, right? I think the docstring here could be improved...","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        Name                Field"},{"line_number":44,"context_line":"        -------------------------"},{"line_number":45,"context_line":"        message_ids           m"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    Messages(Redis Hash):"},{"line_number":48,"context_line":"        Name                Field"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_628d2ad4","line":45,"updated":"2014-08-01 00:06:41.000000000","message":"See comment above...","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        -------------------------"},{"line_number":45,"context_line":"        message_ids           m"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    Messages(Redis Hash):"},{"line_number":48,"context_line":"        Name                Field"},{"line_number":49,"context_line":"        -------------------------"},{"line_number":50,"context_line":"        ttl              -\u003e     t"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_d799561f","line":47,"updated":"2014-08-01 00:06:41.000000000","message":"DSQ: I feel like messages should be scoped to make the DB more human-readable when diagnosing issues. Having different record types (claims, messages) referred to by just UUIDs could make it harder to see what is going on.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    Messages(Redis Hash):"},{"line_number":48,"context_line":"        Name                Field"},{"line_number":49,"context_line":"        -------------------------"},{"line_number":50,"context_line":"        ttl              -\u003e     t"},{"line_number":51,"context_line":"        expires          -\u003e     e"},{"line_number":52,"context_line":"        body             -\u003e     b"},{"line_number":53,"context_line":"        claim            -\u003e     c"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_bd29238b","line":50,"updated":"2014-08-01 00:06:41.000000000","message":"Make sure all fields are documented... seems like some are missing","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        \"\"\"Method to remove all the messages belonging to a queue."},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        Will be referenced from the QueueController."},{"line_number":89,"context_line":"        NOTE(prashanthr_):The pipe to execute deletion will be"},{"line_number":90,"context_line":"        passed from the QueueController executing the operation."},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"        The execution of the pipeline is done by the Queue controller."}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_f5dae149","line":89,"updated":"2014-07-31 16:43:47.000000000","message":"STYLE: Inside docstrings you can just use the .. note:: thing. See also: https://pythonhosted.org/an_example_pypi_project/sphinx.html#paragraph-markup","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        return sorter(messages_set_id, 0, 0)"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _get(self, message_id):"},{"line_number":124,"context_line":"        msg \u003d self._client.get(message_id)"},{"line_number":125,"context_line":"        return msgpack.unpackb(msg) if msg else None"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_b5b789f7","line":124,"updated":"2014-07-31 16:43:47.000000000","message":"BUG: need to set encoding\u003d\u0027utf-8\u0027... perhaps we should create a little wrapper util function?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"18748563cc919dffede5a042be8393dee126e67d","unresolved":false,"context_lines":[{"line_number":133,"context_line":"             include_claimed\u003dFalse):"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        if not self._queue_controller.exists(queue, project):"},{"line_number":136,"context_line":"            raise errors.QueueDoesNotExist(queue,"},{"line_number":137,"context_line":"                                           project)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue,"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_2ddb3e50","line":136,"updated":"2014-07-31 12:22:12.000000000","message":"Mongodb\u0027s driver doesn\u0027t raise `QueueDoesNotExist` on message `list` operations. Mind adding a test for this in the message lifecycle suite?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":136,"context_line":"            raise errors.QueueDoesNotExist(queue,"},{"line_number":137,"context_line":"                                           project)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        messages_set_id \u003d utils.scope_messages_set(queue,"},{"line_number":140,"context_line":"                                                   project,"},{"line_number":141,"context_line":"                                                   QUEUE_MESSAGES_LIST_SUFFIX)"},{"line_number":142,"context_line":"        client \u003d self._client"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_1d384fd3","line":139,"updated":"2014-08-01 00:06:41.000000000","message":"IMO: This name is a little confusing. It seems to imply that the variable refers to \"the ID of the message set\". But what I think it is actually referencing is \"The key for the set of message IDs\".","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        client \u003d self._client"},{"line_number":143,"context_line":"        pipe \u003d self._pipeline"},{"line_number":144,"context_line":"        start \u003d client.zrank(messages_set_id, marker) or 0"},{"line_number":145,"context_line":"        message_ids \u003d client.zrange(messages_set_id, start, start+limit)"},{"line_number":146,"context_line":"        filters \u003d {}"},{"line_number":147,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_d720764d","line":145,"updated":"2014-08-01 00:06:41.000000000","message":"STYLE: The de-facto style for our project is to put spaces around mathematical operators, as in \"start + limit\" vs. \"start+limit\".","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        # 2. echo message to the client."},{"line_number":152,"context_line":"        # 3. Message is expired."},{"line_number":153,"context_line":"        if not include_claimed:"},{"line_number":154,"context_line":"            filters[\u0027claimed\u0027] \u003d {"},{"line_number":155,"context_line":"                \u0027f\u0027: utils.msg_claimed_filter,"},{"line_number":156,"context_line":"                \u0027f.v\u0027: now"},{"line_number":157,"context_line":"            }"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_dc3b3d99","line":154,"updated":"2014-08-01 00:06:41.000000000","message":"You might try using functools.partial here instead. That would simplify applying the filter below (L189-L192)","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            for msg_id in msg_ids:"},{"line_number":182,"context_line":"                pipe.get(msg_id)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            msgs \u003d pipe.execute()"},{"line_number":185,"context_line":"            msgs_unpacked \u003d [msgpack.unpackb(msg) for msg in msgs]"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"            for message in msgs_unpacked:"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_f5b10102","line":184,"updated":"2014-07-31 16:43:47.000000000","message":"BUG: Need to set unpackb kwarg: \n\nencoding\u003d\u0027utf-8\u0027\n\nOtherwise, unpackb will not properly unpack serialized six.text_type strings.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            msg_unpack \u003d msgpack.unpackb"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"            for message in messages:"},{"line_number":247,"context_line":"                if message:"},{"line_number":248,"context_line":"                    yield utils.basic_message(msg_unpack(message), now)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"        return _it(message_ids)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_15acb59e","line":247,"updated":"2014-07-31 16:43:47.000000000","message":"BUG: encoding\u003d\u0027utf-8\u0027","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":267,"context_line":"        num_messages \u003d self._get_count(messages_set_id)"},{"line_number":268,"context_line":"        prepared_messages \u003d ["},{"line_number":269,"context_line":"            {"},{"line_number":270,"context_line":"                \u0027id\u0027: utils.generate_uuid(),"},{"line_number":271,"context_line":"                \u0027t\u0027: message[\u0027ttl\u0027],"},{"line_number":272,"context_line":"                \u0027e\u0027: now + message[\u0027ttl\u0027],"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9597e544","line":269,"updated":"2014-07-31 16:43:47.000000000","message":"DOC: Some of these aren\u0027t listed in the docstring for the MessageController class.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        keys \u003d [message[\"id\"] for message in prepared_messages]"},{"line_number":284,"context_line":"        msgpack_pack \u003d functools.partial(msgpack.packb, use_bin_type\u003dTrue)"},{"line_number":285,"context_line":"        prepared_messages \u003d map(msgpack_pack, prepared_messages)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        add_messages_script \u003d \"\"\""},{"line_number":288,"context_line":"            local index \u003d redis.pcall(\"GET\", KEYS[1])"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_176bce1f","line":285,"updated":"2014-08-01 00:06:41.000000000","message":"STYLE: These days pythonistas tend to prefer list or generator comprehensions over map. I think a list comprehension would be appropriate here.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":284,"context_line":"        msgpack_pack \u003d functools.partial(msgpack.packb, use_bin_type\u003dTrue)"},{"line_number":285,"context_line":"        prepared_messages \u003d map(msgpack_pack, prepared_messages)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        add_messages_script \u003d \"\"\""},{"line_number":288,"context_line":"            local index \u003d redis.pcall(\"GET\", KEYS[1])"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"            if index \u003d\u003d false then"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9c02a570","line":287,"updated":"2014-08-01 00:06:41.000000000","message":"DOC: I think it would be nice to have some inline Lua comments explaining what is going on. Alternatively (or in addition to) you could do some things to make the code more self documenting. I.e.:\n\n    local counter_key \u003d KEYS[1]\n    local message_set_key \u003d KEYS[2]\n    local rank \u003d redis.pcall(\"GET\", counter_key)\n    local num_messages \u003d #ARGV\n\n    if rank \u003d\u003d false then\n        rank \u003d 1\n    else\n        rank \u003d tonumber(rank)\n    end\n\n    for i, message in ipairs(ARGV) do\n        local msg_key \u003d KEYS[i + 2]\n        redis.pcall(\"set\", msg_key, ARGV[i])\n        redis.pcall(\"zadd\", message_set_key, rank + i, msg_key)\n    end\n\n    redis.pcall(\"INCRBY\", counter_key, num_messages)\n    return rank + num_messages","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":301,"context_line":"            redis.pcall(\"INCRBY\", KEYS[1], #ARGV)"},{"line_number":302,"context_line":"            return index+#ARGV"},{"line_number":303,"context_line":"        \"\"\""},{"line_number":304,"context_line":"        # NOTE(prashanthr_): LUA script is used to solve the message ordering"},{"line_number":305,"context_line":"        # inconsistency."},{"line_number":306,"context_line":"        registered_script \u003d self._client.register_script(add_messages_script)"},{"line_number":307,"context_line":"        registered_script(keys\u003d[queue_index_id, messages_set_id]+keys,"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_3c07d91e","line":304,"updated":"2014-08-01 00:06:41.000000000","message":"IMO: This note won\u0027t make sense to people without some context or further explanation. Perhaps mention that it is used for ranking messages using a side counter, as opposed to timestamps, to avoid collisions. Also, using Lua makes the entire operation atomic to avoid two concurrent requests resulting in duplicate ranks.\n\nBTW: We should put together some detailed docs, including diagrams and explanation of the data schema and algorithms used, and why they were designed the way they were. Would be good to have that on our wiki for future contributors. If you like, I can help with that once we have the implementation merged.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        \"\"\""},{"line_number":304,"context_line":"        # NOTE(prashanthr_): LUA script is used to solve the message ordering"},{"line_number":305,"context_line":"        # inconsistency."},{"line_number":306,"context_line":"        registered_script \u003d self._client.register_script(add_messages_script)"},{"line_number":307,"context_line":"        registered_script(keys\u003d[queue_index_id, messages_set_id]+keys,"},{"line_number":308,"context_line":"                          args\u003dprepared_messages)"},{"line_number":309,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_d5887d23","line":306,"updated":"2014-07-31 16:43:47.000000000","message":"DRY/PERF: Can we do this in the class __init__ method rather than every time messages are posted.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        registered_script(keys\u003d[queue_index_id, messages_set_id]+keys,"},{"line_number":308,"context_line":"                          args\u003dprepared_messages)"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        # Using a lock here to ensure atomicity."},{"line_number":311,"context_line":"        with lockutils.lock(messages_set_id):"},{"line_number":312,"context_line":"            self._queue_controller._inc_counter(queue, project, len(messages))"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_373c52bf","line":310,"updated":"2014-08-01 00:06:41.000000000","message":"DSQ: Is this necessary? Incrementing can happen in any order, can\u0027t it? In the end, the counter will still have the same value.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    @utils.raises_conn_error"},{"line_number":365,"context_line":"    @utils.retries_on_connection_error"},{"line_number":366,"context_line":"    def pop(self, queue, limit, project\u003dNone):"},{"line_number":367,"context_line":"        # Pop is implemented as a list and delete operation."},{"line_number":368,"context_line":"        messages \u003d list(self.list(queue, project, limit\u003dlimit))"},{"line_number":369,"context_line":"        message_ids \u003d [message[\u0027id\u0027] for message in messages]"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_82f31e6c","line":366,"updated":"2014-08-01 00:06:41.000000000","message":"BUG: This operation is defined to be equivalent to a claim and delete. Multiple concurrent requests are not allowed to return any of the same messages. If pipelines are atomic, you could do the list and bulk delete in a single pipeline request. Alternatively, you could claim rather than list the messages and then delete them and release the claim before returning.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"}],"marconi/queues/storage/redis/options.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    cfg.IntOpt(\u0027database\u0027, default\u003d0, help\u003d\u0027Database number\u0027),"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    cfg.BoolOpt(\u0027useSocketPath\u0027, default\u003dFalse,"},{"line_number":26,"context_line":"                help\u003d\u0027Use the Unix socket path between client and Redis.\u0027),"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027sockPath\u0027, default\u003d\u0027/tmp/redis.sock\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_fd5cccf2","line":25,"updated":"2014-06-17 05:26:01.000000000","message":"useSocketPath -\u003e use_socket_path","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    cfg.BoolOpt(\u0027useSocketPath\u0027, default\u003dFalse,"},{"line_number":26,"context_line":"                help\u003d\u0027Use the Unix socket path between client and Redis.\u0027),"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    cfg.StrOpt(\u0027sockPath\u0027, default\u003d\u0027/tmp/redis.sock\u0027,"},{"line_number":29,"context_line":"               help\u003d\u0027Unix socket path defined by redis.\u0027),"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    cfg.IntOpt(\u0027max_attempts\u0027, default\u003d1000,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_1d6258ad","line":28,"updated":"2014-06-17 05:26:01.000000000","message":"sockPath -\u003e sock_path","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":13,"context_line":"# limitations under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"\"\"\"Redis storage driver configuration options.\"\"\""},{"line_number":16,"context_line":"from oslo.config import cfg"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_32daed79","line":15,"updated":"2014-06-24 06:11:49.000000000","message":"a new line","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"4613d1a7e7fc1f7c311a256bcea9e3a9b677de93","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":21,"context_line":"               help\u003d\u0027Redis Server URI.\u0027),"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    cfg.IntOpt(\u0027database\u0027, default\u003d0, help\u003d\u0027Database number\u0027),"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    cfg.BoolOpt(\u0027use_socket_path\u0027, default\u003dFalse,"},{"line_number":26,"context_line":"                help\u003d\u0027Use the Unix socket path between client and Redis.\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_37e8ebb3","line":23,"updated":"2014-07-10 19:23:42.000000000","message":"Could you expand this help text? It\u0027s not clear to users unfamiliar with Redis that \u0027Database number\u0027 serves to create a separate keyspace indexed by number.","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"REDIS_OPTIONS \u003d ("},{"line_number":20,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":21,"context_line":"               help\u003d\u0027Redis Server URI.\u0027),"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    cfg.IntOpt(\u0027database\u0027, default\u003d0,"},{"line_number":24,"context_line":"               help\u003d(\u0027Database number serves to create \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_745c611a","line":21,"updated":"2014-07-22 23:30:09.000000000","message":"The help text should describe the URI schema, since it is specific to Marconi (afaik, the Redis project does not define a canonical connection string format).","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"REDIS_OPTIONS \u003d ("},{"line_number":20,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":21,"context_line":"               help\u003d\u0027Redis Server URI.\u0027),"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    cfg.IntOpt(\u0027database\u0027, default\u003d0,"},{"line_number":24,"context_line":"               help\u003d(\u0027Database number serves to create \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e0ffba33","line":21,"in_reply_to":"baada198_745c611a","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":21,"context_line":"               help\u003d\u0027Redis Server URI.\u0027),"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    cfg.IntOpt(\u0027database\u0027, default\u003d0,"},{"line_number":24,"context_line":"               help\u003d(\u0027Database number serves to create \u0027"},{"line_number":25,"context_line":"                     \u0027a separate key space indexed by number.\u0027)),"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_66cd94b7","line":23,"updated":"2014-07-22 23:30:09.000000000","message":"IMO: Seems like this config option doesn\u0027t make sense for the Redis driver?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":20,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":21,"context_line":"               help\u003d\u0027Redis Server URI.\u0027),"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    cfg.IntOpt(\u0027database\u0027, default\u003d0,"},{"line_number":24,"context_line":"               help\u003d(\u0027Database number serves to create \u0027"},{"line_number":25,"context_line":"                     \u0027a separate key space indexed by number.\u0027)),"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_80bd1e6a","line":23,"in_reply_to":"baada198_66cd94b7","updated":"2014-07-23 13:20:33.000000000","message":"I thought we could use it to split up the queues on the basis of priority if required.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":24,"context_line":"               help\u003d(\u0027Database number serves to create \u0027"},{"line_number":25,"context_line":"                     \u0027a separate key space indexed by number.\u0027)),"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    cfg.BoolOpt(\u0027use_socket_path\u0027, default\u003dFalse,"},{"line_number":28,"context_line":"                help\u003d\u0027Use the Unix socket path between client and Redis.\u0027),"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027sock_path\u0027, default\u003d\u0027/tmp/redis.sock\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_31583b57","line":27,"updated":"2014-07-22 23:30:09.000000000","message":"DRY: Rather than having two different settings for specifying connection information, this can be done by simply utilizing the non-authority URI form, i.e.:\n\n    # TCP Connection\n    redis://127.0.0.1:6379\n\n    # UNIX Domain Socket\n    redis:/tmp/redis.sock\n\nSee also: https://en.wikipedia.org/wiki/URI_scheme","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":24,"context_line":"               help\u003d(\u0027Database number serves to create \u0027"},{"line_number":25,"context_line":"                     \u0027a separate key space indexed by number.\u0027)),"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"    cfg.BoolOpt(\u0027use_socket_path\u0027, default\u003dFalse,"},{"line_number":28,"context_line":"                help\u003d\u0027Use the Unix socket path between client and Redis.\u0027),"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    cfg.StrOpt(\u0027sock_path\u0027, default\u003d\u0027/tmp/redis.sock\u0027,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c0b71684","line":27,"in_reply_to":"baada198_31583b57","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    cfg.StrOpt(\u0027sock_path\u0027, default\u003d\u0027/tmp/redis.sock\u0027,"},{"line_number":31,"context_line":"               help\u003d\u0027Unix socket path defined by redis.\u0027),"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027max_attempts\u0027, default\u003d1000,"},{"line_number":34,"context_line":"               help\u003d(\u0027Maximum number of times to retry a failed operation. \u0027"},{"line_number":35,"context_line":"                     \u0027Currently only used for retrying a message post.\u0027)),"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e699a47a","line":33,"updated":"2014-07-22 23:30:09.000000000","message":"YAGNI: This config option is not used, and can be removed","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    cfg.StrOpt(\u0027sock_path\u0027, default\u003d\u0027/tmp/redis.sock\u0027,"},{"line_number":31,"context_line":"               help\u003d\u0027Unix socket path defined by redis.\u0027),"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    cfg.IntOpt(\u0027max_attempts\u0027, default\u003d1000,"},{"line_number":34,"context_line":"               help\u003d(\u0027Maximum number of times to retry a failed operation. \u0027"},{"line_number":35,"context_line":"                     \u0027Currently only used for retrying a message post.\u0027)),"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_231b7c74","line":33,"in_reply_to":"baada198_e699a47a","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":34,"context_line":"               help\u003d(\u0027Maximum number of times to retry a failed operation. \u0027"},{"line_number":35,"context_line":"                     \u0027Currently only used for retrying a message post.\u0027)),"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    cfg.FloatOpt(\u0027max_retry_sleep\u0027, default\u003d0.1,"},{"line_number":38,"context_line":"                 help\u003d(\u0027Maximum sleep interval between retries \u0027"},{"line_number":39,"context_line":"                       \u0027(actual sleep time increases linearly \u0027"},{"line_number":40,"context_line":"                       \u0027according to number of attempts performed).\u0027)),"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_06869816","line":37,"updated":"2014-07-22 23:30:09.000000000","message":"YAGNI: This config option is not used, and can be removed","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":34,"context_line":"               help\u003d(\u0027Maximum number of times to retry a failed operation. \u0027"},{"line_number":35,"context_line":"                     \u0027Currently only used for retrying a message post.\u0027)),"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    cfg.FloatOpt(\u0027max_retry_sleep\u0027, default\u003d0.1,"},{"line_number":38,"context_line":"                 help\u003d(\u0027Maximum sleep interval between retries \u0027"},{"line_number":39,"context_line":"                       \u0027(actual sleep time increases linearly \u0027"},{"line_number":40,"context_line":"                       \u0027according to number of attempts performed).\u0027)),"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_4316b04a","line":37,"in_reply_to":"baada198_06869816","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                       \u0027(actual sleep time increases linearly \u0027"},{"line_number":40,"context_line":"                       \u0027according to number of attempts performed).\u0027)),"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    cfg.FloatOpt(\u0027max_retry_jitter\u0027, default\u003d0.005,"},{"line_number":43,"context_line":"                 help\u003d(\u0027Maximum jitter interval, to be added to the \u0027"},{"line_number":44,"context_line":"                       \u0027sleep interval, in order to decrease probability \u0027"},{"line_number":45,"context_line":"                       \u0027that parallel requests will retry at the \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_268b9c1f","line":42,"updated":"2014-07-22 23:30:09.000000000","message":"YAGNI: This config option is not used, and can be removed","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":39,"context_line":"                       \u0027(actual sleep time increases linearly \u0027"},{"line_number":40,"context_line":"                       \u0027according to number of attempts performed).\u0027)),"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    cfg.FloatOpt(\u0027max_retry_jitter\u0027, default\u003d0.005,"},{"line_number":43,"context_line":"                 help\u003d(\u0027Maximum jitter interval, to be added to the \u0027"},{"line_number":44,"context_line":"                       \u0027sleep interval, in order to decrease probability \u0027"},{"line_number":45,"context_line":"                       \u0027that parallel requests will retry at the \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_632494b2","line":42,"in_reply_to":"baada198_268b9c1f","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    cfg.IntOpt(\u0027max_reconnect_attempts\u0027, default\u003d10,"},{"line_number":49,"context_line":"               help\u003d(\u0027Maximum number of times to retry an operation that \u0027"},{"line_number":50,"context_line":"                     \u0027failed due to a primary node failover.\u0027)),"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    cfg.FloatOpt(\u0027reconnect_sleep\u0027, default\u003d0.020,"},{"line_number":53,"context_line":"                 help\u003d(\u0027Base sleep interval between attempts to reconnect \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_06dbf821","line":50,"updated":"2014-07-22 23:30:09.000000000","message":"DOC: This should be reworded, since this language doesn\u0027t make sense in the context of Redis (there is no \"primary node failover\" as in Mongo, and we cannot use the standard Redis cluster feature due to race conditions).","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    cfg.IntOpt(\u0027max_reconnect_attempts\u0027, default\u003d10,"},{"line_number":49,"context_line":"               help\u003d(\u0027Maximum number of times to retry an operation that \u0027"},{"line_number":50,"context_line":"                     \u0027failed due to a primary node failover.\u0027)),"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    cfg.FloatOpt(\u0027reconnect_sleep\u0027, default\u003d0.020,"},{"line_number":53,"context_line":"                 help\u003d(\u0027Base sleep interval between attempts to reconnect \u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_23b7fc3b","line":50,"in_reply_to":"baada198_06dbf821","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    cfg.FloatOpt(\u0027reconnect_sleep\u0027, default\u003d0.020,"},{"line_number":53,"context_line":"                 help\u003d(\u0027Base sleep interval between attempts to reconnect \u0027"},{"line_number":54,"context_line":"                       \u0027after a primary node failover. \u0027"},{"line_number":55,"context_line":"                       \u0027The actual sleep time increases exponentially (power \u0027"},{"line_number":56,"context_line":"                       \u0027of 2) each time the operation is retried.\u0027)),"},{"line_number":57,"context_line":")"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a6cb2c49","line":54,"updated":"2014-07-22 23:30:09.000000000","message":"See DOC comment above.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    cfg.FloatOpt(\u0027reconnect_sleep\u0027, default\u003d0.020,"},{"line_number":53,"context_line":"                 help\u003d(\u0027Base sleep interval between attempts to reconnect \u0027"},{"line_number":54,"context_line":"                       \u0027after a primary node failover. \u0027"},{"line_number":55,"context_line":"                       \u0027The actual sleep time increases exponentially (power \u0027"},{"line_number":56,"context_line":"                       \u0027of 2) each time the operation is retried.\u0027)),"},{"line_number":57,"context_line":")"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_03a838d8","line":54,"in_reply_to":"baada198_a6cb2c49","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":12,"context_line":"# See the License for the specific language governing permissions and"},{"line_number":13,"context_line":"# limitations under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"\"\"\"Redis storage driver configuration options.\"\"\""},{"line_number":16,"context_line":"from oslo.config import cfg"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_82ffc234","line":15,"updated":"2014-07-31 06:36:47.000000000","message":"NIT: how about an empty line here?","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"REDIS_OPTIONS \u003d ("},{"line_number":20,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":21,"context_line":"               help\u003d\u0027Redis Server URI. Can also use a \u0027"},{"line_number":22,"context_line":"                    \u0027socket file based connector. \u0027"},{"line_number":23,"context_line":"                    \u0027Ex: redis:///tmp/redis.sock\u0027),"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_22643620","line":21,"updated":"2014-07-31 06:36:47.000000000","message":"(....)  here?","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":21,"context_line":"    cfg.StrOpt(\u0027uri\u0027, default\u003d\"redis://127.0.0.1:6379\","},{"line_number":22,"context_line":"               help\u003d(\u0027Redis Server URI. Can also use a \u0027"},{"line_number":23,"context_line":"                     \u0027socket file based connector. \u0027"},{"line_number":24,"context_line":"                     \u0027Ex: redis:///tmp/redis.sock\u0027)),"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    cfg.IntOpt(\u0027max_reconnect_attempts\u0027, default\u003d10,"},{"line_number":27,"context_line":"               help\u003d(\u0027Maximum number of times to retry an operation that \u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_82115efa","line":24,"updated":"2014-08-01 00:06:41.000000000","message":"BUG: RFC3986 specifies that double-slash is present only when given an authority. Otherwise, the path portion of the URI follows immediately after the colon. Therefore, the example should read:\n\n\u0027Ex: redis:/tmp/redis.sock\u0027","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"18748563cc919dffede5a042be8393dee126e67d","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    cfg.FloatOpt(\u0027reconnect_sleep\u0027, default\u003d1,"},{"line_number":31,"context_line":"                 help\u003d(\u0027Base sleep interval between attempts to reconnect \u0027"},{"line_number":32,"context_line":"                       \u0027after a redis node failover. \u0027))"},{"line_number":33,"context_line":")"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"REDIS_GROUP \u003d \u0027drivers:storage:redis\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_f201216e","line":32,"updated":"2014-07-31 12:22:12.000000000","message":"SHould we also have options for `db` and `password`? I\u0027d like to see one for `db`, I\u0027m not sure about the later, though.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"}],"marconi/queues/storage/redis/queues.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":165,"context_line":"        qset_id \u003d utils.scope_queue_name(QUEUES_SET_STORE_NAME, project)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        return not self._client.zrank(qset_id, q_id) is None"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @utils.raises_conn_error"},{"line_number":170,"context_line":"    @utils.retries_on_autoreconnect"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_3ddc7446","line":167,"updated":"2014-06-17 05:26:01.000000000","message":"This is a subtle error - it will always return False. Use instead:\n\n    return self._client.zrank(...) is not None\n\nHere\u0027s why, explained using evaluation order:\n\n* self._client.zrank(qset_id, q_id) -\u003e Maybe [elems] as ret\n* if ret is True-ish -\u003e (not ret) \u003d\u003d False\n* if ret is False-ish -\u003e (not ret) \u003d\u003d True\n* True-ish/False-ish is None -\u003e False\n\n(4) follows from the fact that only one value can satisfy \u0027is None\u0027 -- None. By negating None (not None), we are guaranteeing that this will never evaluate to True.\n\n* True-ish: [1]\n* False-ish: [], None","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    @utils.raises_conn_error"},{"line_number":138,"context_line":"    @utils.reset_pipeline"},{"line_number":139,"context_line":"    def create(self, name, project\u003dNone):"},{"line_number":140,"context_line":"        # Note (prashanthr_): Implement as a lua script."},{"line_number":141,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":142,"context_line":"        qset_id \u003d utils.scope_queue_name(QUEUES_SET_STORE_NAME, project)"},{"line_number":143,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_677c8a73","line":140,"updated":"2014-07-10 10:27:09.000000000","message":"(nit): Please using NOTE","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":161,"context_line":"    @utils.raises_conn_error"},{"line_number":162,"context_line":"    @utils.retries_on_autoreconnect"},{"line_number":163,"context_line":"    def exists(self, name, project\u003dNone):"},{"line_number":164,"context_line":"        # Note (prashanthr_): try to fit in caching if possible."},{"line_number":165,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":166,"context_line":"        qset_id \u003d utils.scope_queue_name(QUEUES_SET_STORE_NAME, project)"},{"line_number":167,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_4785c657","line":164,"updated":"2014-07-10 10:27:09.000000000","message":"(nit): pls use NOTE","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"ae4c6fcd56001679d37e8f7b727553b138c89fe4","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    @utils.retries_on_autoreconnect"},{"line_number":192,"context_line":"    @utils.reset_pipeline"},{"line_number":193,"context_line":"    def delete(self, name, project\u003dNone):"},{"line_number":194,"context_line":"        # Pipelining is used to ensure no race conditions"},{"line_number":195,"context_line":"        # occur."},{"line_number":196,"context_line":"        if not self.exists(name, project):"},{"line_number":197,"context_line":"            raise errors.QueueDoesNotExist(name, project)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_27e9b21a","line":194,"updated":"2014-07-10 10:27:09.000000000","message":"How about using a well-format docstring?","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"4613d1a7e7fc1f7c311a256bcea9e3a9b677de93","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    @utils.retries_on_autoreconnect"},{"line_number":192,"context_line":"    @utils.reset_pipeline"},{"line_number":193,"context_line":"    def delete(self, name, project\u003dNone):"},{"line_number":194,"context_line":"        # Pipelining is used to ensure no race conditions"},{"line_number":195,"context_line":"        # occur."},{"line_number":196,"context_line":"        if not self.exists(name, project):"},{"line_number":197,"context_line":"            raise errors.QueueDoesNotExist(name, project)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_778983c9","line":194,"in_reply_to":"baada198_27e9b21a","updated":"2014-07-10 19:23:42.000000000","message":"I\u0027d prefer a NOTE here, as the pipelining comment is an implementation detail.","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"b2cabef8797da2c3b2c4629c96977c5ca8cc59f9","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        start \u003d client.zrank(qset_id, marker) or 0"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"        cursor \u003d (q for q in client.zrange(qset_id, start,"},{"line_number":114,"context_line":"                                           start + (limit - 1)))"},{"line_number":115,"context_line":"        marker_next \u003d {}"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        def denormalizer(q_info, q_name):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_affdbf3d","line":114,"updated":"2014-07-16 16:50:03.000000000","message":"Q: what is the reason to do it like this and not to do just\n\ncursor \u003d client.zrange(...) ?\n\nI just cannot find a reason)","commit_id":"6d294cfe349da72d0b2d9ee6df97540bd3d74501"},{"author":{"_account_id":6413,"name":"Victoria Martinez de la Cruz","email":"victoria@redhat.com","username":"vkmc"},"change_message_id":"02f2e29eaa949932d711f00f0195b243704bcf6c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        }"},{"line_number":89,"context_line":"        self._client.hmset(q_id, q_info)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":92,"context_line":"        super(QueueController, self).__init__(*args, **kwargs)"},{"line_number":93,"context_line":"        self.init_connection()"},{"line_number":94,"context_line":"        self._init_pipeline()"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_ea9633ef","line":91,"updated":"2014-07-21 12:30:06.000000000","message":"nit: ditto \u0027messages.py\u0027","commit_id":"bc0acaae4844f90e419beeb1a15d3e8a227b6226"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    def init_connection(self):"},{"line_number":63,"context_line":"        \"\"\"Will be used during reconnection attempts."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        \"\"\""},{"line_number":66,"context_line":"        self._client \u003d self.driver.connection"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_26071c83","line":64,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Remove blank line (place trailing \"\"\" on the same line as the title sentence)","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    @utils.raises_conn_error"},{"line_number":139,"context_line":"    @utils.reset_pipeline"},{"line_number":140,"context_line":"    def create(self, name, project\u003dNone):"},{"line_number":141,"context_line":"        # Note(prashanthr_): Implement as a lua script."},{"line_number":142,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":143,"context_line":"        qset_id \u003d utils.scope_queue_name(QUEUES_SET_STORE_NAME, project)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_865b8854","line":141,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: \"Note\" ---\u003e \"NOTE\". Please update all such comments in this patch. Thanks!","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    @utils.raises_conn_error"},{"line_number":139,"context_line":"    @utils.reset_pipeline"},{"line_number":140,"context_line":"    def create(self, name, project\u003dNone):"},{"line_number":141,"context_line":"        # Note(prashanthr_): Implement as a lua script."},{"line_number":142,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":143,"context_line":"        qset_id \u003d utils.scope_queue_name(QUEUES_SET_STORE_NAME, project)"},{"line_number":144,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_83ea880c","line":141,"in_reply_to":"baada198_865b8854","updated":"2014-07-23 13:20:33.000000000","message":"Really sorry about this.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            \u0027c\u0027: 1,"},{"line_number":153,"context_line":"            \u0027cl\u0027: 0,"},{"line_number":154,"context_line":"            \u0027m\u0027: {},"},{"line_number":155,"context_line":"            \u0027t\u0027: timeutils.utcnow_ts()"},{"line_number":156,"context_line":"        }"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        pipe.zadd(qset_id, 1, q_id).hmset(q_id, q_info)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_69a807dc","line":155,"updated":"2014-07-22 23:30:09.000000000","message":"DOC: The \u0027t\u0027 field is not documented in the QueueController docstring","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":152,"context_line":"            \u0027c\u0027: 1,"},{"line_number":153,"context_line":"            \u0027cl\u0027: 0,"},{"line_number":154,"context_line":"            \u0027m\u0027: {},"},{"line_number":155,"context_line":"            \u0027t\u0027: timeutils.utcnow_ts()"},{"line_number":156,"context_line":"        }"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        pipe.zadd(qset_id, 1, q_id).hmset(q_id, q_info)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c3cba0a2","line":155,"in_reply_to":"baada198_69a807dc","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if self.exists(name, project):"},{"line_number":186,"context_line":"            q_info[\u0027c\u0027] \u003d self._get_queue_info(q_id, \u0027c\u0027)"},{"line_number":187,"context_line":"            q_info[\u0027cl\u0027] \u003d self._get_queue_info(q_id, \u0027cl\u0027)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        self._client.hmset(q_id, q_info)"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a934dfdf","line":187,"updated":"2014-07-22 23:30:09.000000000","message":"PERF: Can we get \u0027c\u0027 and \u0027cl\u0027 in a single request?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        if self.exists(name, project):"},{"line_number":186,"context_line":"            q_info[\u0027c\u0027] \u003d self._get_queue_info(q_id, \u0027c\u0027)"},{"line_number":187,"context_line":"            q_info[\u0027cl\u0027] \u003d self._get_queue_info(q_id, \u0027cl\u0027)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        self._client.hmset(q_id, q_info)"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_63b494d4","line":187,"in_reply_to":"baada198_a934dfdf","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            q_info[\u0027c\u0027] \u003d self._get_queue_info(q_id, \u0027c\u0027)"},{"line_number":187,"context_line":"            q_info[\u0027cl\u0027] \u003d self._get_queue_info(q_id, \u0027cl\u0027)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        self._client.hmset(q_id, q_info)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @utils.raises_conn_error"},{"line_number":192,"context_line":"    @utils.retries_on_autoreconnect"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_299e0fb9","line":189,"updated":"2014-07-22 23:30:09.000000000","message":"BUG: There\u0027s a race condition in between copying the \"current\" value of the side counter and then persisting it back. Between L186 and L189, a different request may be serviced that causes \u0027c\u0027 to be incremented. Then, in L189 we would revert to the previous counter value.\n\nIdeally, we could just set the \u0027m\u0027 field and not touch anything else. If that is not possible, we need to make this entire thing atomic by using a pipeline or lua script.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":186,"context_line":"            q_info[\u0027c\u0027] \u003d self._get_queue_info(q_id, \u0027c\u0027)"},{"line_number":187,"context_line":"            q_info[\u0027cl\u0027] \u003d self._get_queue_info(q_id, \u0027cl\u0027)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        self._client.hmset(q_id, q_info)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    @utils.raises_conn_error"},{"line_number":192,"context_line":"    @utils.retries_on_autoreconnect"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0382f8a4","line":189,"in_reply_to":"baada198_299e0fb9","updated":"2014-07-23 13:20:33.000000000","message":"Thanks a lot for this. I just got to know that you can just set the \u0027m\u0027 field directly.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        pipe.zrem(qset_id, q_id)"},{"line_number":206,"context_line":"        pipe.delete(q_id)"},{"line_number":207,"context_line":"        self.driver.message_controller._delete_queue_messages(name, project)"},{"line_number":208,"context_line":"        pipe.execute()"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_697f2767","line":207,"updated":"2014-07-22 23:30:09.000000000","message":"DSQ: What do you think about passing pipe to _delete_queue_messages so everything can be part of the same transaction?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        pipe.zrem(qset_id, q_id)"},{"line_number":206,"context_line":"        pipe.delete(q_id)"},{"line_number":207,"context_line":"        self.driver.message_controller._delete_queue_messages(name, project)"},{"line_number":208,"context_line":"        pipe.execute()"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a3b4ec82","line":207,"in_reply_to":"baada198_697f2767","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"18748563cc919dffede5a042be8393dee126e67d","unresolved":false,"context_lines":[{"line_number":144,"context_line":""},{"line_number":145,"context_line":"        pipe \u003d self._pipeline"},{"line_number":146,"context_line":"        # Check if the queue already exists."},{"line_number":147,"context_line":"        if self._client.zrank(qset_id, q_id) is not None:"},{"line_number":148,"context_line":"            return False"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        # Pipeline ensures atomic inserts."}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_ed2306a8","line":147,"range":{"start_line":147,"start_character":16,"end_line":147,"end_character":23},"updated":"2014-07-31 12:22:12.000000000","message":"Should this use `self.exists(name, project)` ?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"18748563cc919dffede5a042be8393dee126e67d","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        pipe.zadd(qset_id, 1, q_id).hmset(q_id, q_info)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        return all(map(bool, pipe.execute()))"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    @utils.raises_conn_error"},{"line_number":163,"context_line":"    @utils.retries_on_connection_error"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_926f05fa","line":160,"range":{"start_line":160,"start_character":23,"end_line":160,"end_character":27},"updated":"2014-07-31 12:22:12.000000000","message":"Are these `all` and `map` really necessary? Is there a better way to know if the pipe execution succeeded w/o having to iterate 2 times through it?\n\nAlso, is there any exception/error to catch/report here?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"18748563cc919dffede5a042be8393dee126e67d","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        # NOTE(prashanthr_): Pipelining is used to ensure no race conditions"},{"line_number":189,"context_line":"        # occur."},{"line_number":190,"context_line":"        if not self.exists(name, project):"},{"line_number":191,"context_line":"            raise errors.QueueDoesNotExist(name, project)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":194,"context_line":"        qset_id \u003d utils.scope_queue_name(QUEUES_SET_STORE_NAME, project)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_0d83da55","line":191,"updated":"2014-07-31 12:22:12.000000000","message":"we don\u0027t raise `QueueDoesNotExist` for deletes. At least, the mongodb driver, doesn\u0027t. Would you mind adding some tests for this in the queue-lifecycle test?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"18748563cc919dffede5a042be8393dee126e67d","unresolved":false,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        pipe.zrem(qset_id, q_id)"},{"line_number":199,"context_line":"        pipe.delete(q_id)"},{"line_number":200,"context_line":"        self.driver.message_controller._delete_queue_messages(name, project,"},{"line_number":201,"context_line":"                                                              pipe)"},{"line_number":202,"context_line":"        pipe.execute()"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_cddf2265","line":200,"updated":"2014-07-31 12:22:12.000000000","message":"Should messages deletion happen *before* the queue is deleted? Will this happen in the pipeline?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"}],"marconi/queues/storage/redis/shards.py":[{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":41,"context_line":"# Datastructure id for the list of shards"},{"line_number":42,"context_line":"SHARDS_SET_NAME \u003d \"shards\""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class ShardsController(base.ShardsBase):"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def list(self, marker\u003dNone, limit\u003dstorage.DEFAULT_SHARDS_PER_PAGE,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_d260e9a6","line":44,"updated":"2014-06-24 06:11:49.000000000","message":"Rename to Pool(s)xxxxxx","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"}],"marconi/queues/storage/redis/utils.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    \"\"\"Check if the metadata for a queue is empty."},{"line_number":31,"context_line":"        Empty metadata is represented as \u0027{}\u0027"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return metadata is \u0027{}\u0027"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def descope_queue_name(scoped_name):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_7d935c5c","line":33,"updated":"2014-06-17 05:26:01.000000000","message":"Because of the way `is` works, this will only return True if metadata and the constant \u0027{}\u0027 happen to share the same memory address. Use:\n\n    return metadata \u003d\u003d \u0027{}\u0027","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":8092,"name":"Sriram Madapusi Vasudevan","email":"sriram1991mv@gmail.com","username":"thesriram"},"change_message_id":"0c5371c893ce76f374415e4352183ed6f41734c0","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    \"\"\"Check if the metadata for a queue is empty."},{"line_number":31,"context_line":"        Empty metadata is represented as \u0027{}\u0027"},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    return metadata is \u0027{}\u0027"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def descope_queue_name(scoped_name):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_7c0430c6","line":33,"in_reply_to":"1ae5cdf2_7d935c5c","updated":"2014-06-17 12:54:20.000000000","message":"+1","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    \"\"\"Returns the queue name from the scoped name"},{"line_number":38,"context_line":"        which is of the form project-id_queue-name"},{"line_number":39,"context_line":"    \"\"\""},{"line_number":40,"context_line":"    return scoped_name.split(\u0027.\u0027)[1]"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"def descope_from_catalogue(scoped_name):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_7d7a7c26","line":40,"updated":"2014-06-17 05:26:01.000000000","message":"The docstring and this implementation do not match. In the docstring, you say \u0027project-id_queue-name\u0027, but the implementation tells me \u0027project-id.queue-name\u0027\n\n_ or .\n\n?","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"6071634c0f4a12aa817fb991565d38adf594fbbc","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    string concatenation when a variable could be None."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    #Note(prashanthr_) : Try to reuse this utility. Violates DRY"},{"line_number":58,"context_line":"    return \u0027\u0027 if string_or_none is None else string_or_none"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def generate_uuid():"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ae5cdf2_7da19c94","line":58,"updated":"2014-06-17 05:26:01.000000000","message":"Oh cool, a Monoid construction. By converting None to -\u003e \u0027\u0027, you\u0027ve enforced an identity element on strings. Very nice. :)","commit_id":"8c59e11e871be5245657671e0767689f27f363b6"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"624e8c03be1e49dfdf7161cbc3b4464ce6577898","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from marconi.openstack.common import log as logging"},{"line_number":18,"context_line":"from marconi.queues.storage import errors"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"import redis"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":"import time"},{"line_number":23,"context_line":"import uuid"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_526cd99d","line":20,"updated":"2014-06-24 06:11:49.000000000","message":"please modify the imports order as \n\nbuild-in\n\nthird-party\n\napplication","commit_id":"68a607d055b96082d4526044a07be239ce23ec85"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"4613d1a7e7fc1f7c311a256bcea9e3a9b677de93","unresolved":false,"context_lines":[{"line_number":227,"context_line":"def get_hostport(uri):"},{"line_number":228,"context_line":"    \"\"\"This utility fetches the host and port"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        from the shard uri provided."},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        NOTE(prashanthr): Check up with"},{"line_number":233,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_17c047df","line":230,"updated":"2014-07-10 19:23:42.000000000","message":"shard -\u003e pool","commit_id":"6204d26c89ca3ce5ec255603583d76b1e2007de3"},{"author":{"_account_id":7498,"name":"Malini Kamalambal","email":"malini.kamalambal@rackspace.com","username":"malini-pk"},"change_message_id":"4d5547cd88fa071f6bef0953f851d6fbff3627bd","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    @functools.wraps(func)"},{"line_number":144,"context_line":"    def wrapper(self, *args, **kwargs):"},{"line_number":145,"context_line":"        # TODO(kgriffs): Figure out a way to not have to rely on the"},{"line_number":146,"context_line":"        # Note(prashanthr_) : Try to reuse this utility. Violates DRY"},{"line_number":147,"context_line":"        # Can pass config parameters into the decorator and create a"},{"line_number":148,"context_line":"        # storage level utility."}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0ce87915","line":145,"updated":"2014-07-16 16:07:36.000000000","message":"might want to complete or get rid of the above comment.","commit_id":"6d294cfe349da72d0b2d9ee6df97540bd3d74501"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"b2cabef8797da2c3b2c4629c96977c5ca8cc59f9","unresolved":false,"context_lines":[{"line_number":201,"context_line":""},{"line_number":202,"context_line":"def msg_claimed_filter(message, now):"},{"line_number":203,"context_line":"    \"\"\"This utility verifies in the current message"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        has been claimed."},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        Used with message pagination while returning"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0f494b8e","line":204,"updated":"2014-07-16 16:50:03.000000000","message":"Does this empty lines should be there? There are a lot of them in docs below, sometimes splitting the sentences.","commit_id":"6d294cfe349da72d0b2d9ee6df97540bd3d74501"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":29,"context_line":"def is_metadata_empty(metadata):"},{"line_number":30,"context_line":"    \"\"\"Empty metadata check."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"        Check if the metadata for a queue is empty."},{"line_number":33,"context_line":"        Empty metadata is represented as \u0027{}\u0027."},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    return metadata \u003d\u003d \u0027{}\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_29d60f28","line":32,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":38,"context_line":"def descope_queue_name(scoped_name):"},{"line_number":39,"context_line":"    \"\"\"Descope Queue name with \u0027.\u0027."},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"       Returns the queue name from the scoped name"},{"line_number":42,"context_line":"       which is of the form project-id.queue-name"},{"line_number":43,"context_line":"    \"\"\""},{"line_number":44,"context_line":"    return scoped_name.split(\u0027.\u0027)[1]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_49db434f","line":41,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":47,"context_line":"def descope_from_catalogue(scoped_name):"},{"line_number":48,"context_line":"    \"\"\"Descope catalogue name with \u0027.\u0027."},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"        Returns the catalogue name from the scoped name"},{"line_number":51,"context_line":"        which is of the form project-id.queue-name"},{"line_number":52,"context_line":"    \"\"\""},{"line_number":53,"context_line":"    project, queue \u003d scoped_name.split(\u0027.\u0027)[:1]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_89e47b0f","line":50,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    This function normalizes None to the empty string to facilitate"},{"line_number":61,"context_line":"    string concatenation when a variable could be None."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    # Note(prashanthr_) : Try to reuse this utility. Violates DRY"},{"line_number":64,"context_line":"    return \u0027\u0027 if string_or_none is None else string_or_none"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e91417eb","line":63,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Should this be a TODO rather than a NOTE?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"def retries_on_autoreconnect(func):"},{"line_number":128,"context_line":"    \"\"\"Causes the wrapped function to be re-called on AutoReconnect."},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    This decorator catches Redis ConnectionError and retries"},{"line_number":131,"context_line":"    the function call."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a645ec16","line":128,"updated":"2014-07-22 23:30:09.000000000","message":"NIT: \"AutoReconnect\" is a mongo term","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    @functools.wraps(func)"},{"line_number":142,"context_line":"    def wrapper(self, *args, **kwargs):"},{"line_number":143,"context_line":"        # Note(prashanthr_) : Try to reuse this utility. Violates DRY"},{"line_number":144,"context_line":"        # Can pass config parameters into the decorator and create a"},{"line_number":145,"context_line":"        # storage level utility."},{"line_number":146,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_095cebef","line":143,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Should this be a TODO instead of a NOTE?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        for attempt in range(max_attemps):"},{"line_number":151,"context_line":"            try:"},{"line_number":152,"context_line":"                self.init_connection()"},{"line_number":153,"context_line":"                return func(self, *args, **kwargs)"},{"line_number":154,"context_line":"                break"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c6c5805d","line":152,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: It would be OK to use the \"_\" prefix for this method name; it should be considered semi-private, only to be used by \"friends\" of the controller class. We\u0027ve followed this pattern elsewhere.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"1a751a72d9982aa874eae5211c557dcaead7ebc5","unresolved":false,"context_lines":[{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        for attempt in range(max_attemps):"},{"line_number":151,"context_line":"            try:"},{"line_number":152,"context_line":"                self.init_connection()"},{"line_number":153,"context_line":"                return func(self, *args, **kwargs)"},{"line_number":154,"context_line":"                break"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_261b8a74","line":152,"in_reply_to":"baada198_c6c5805d","updated":"2014-07-23 13:20:33.000000000","message":"Done","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                break"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"            except redis.exceptions.ConnectionError as ex:"},{"line_number":157,"context_line":"                LOG.warn(_(u\u0027Caught AutoReconnect, retrying the \u0027"},{"line_number":158,"context_line":"                           \u0027call to {0}\u0027).format(func))"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"                time.sleep(sleep_sec * (2 ** attempt))"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e6fd24b3","line":157,"updated":"2014-07-22 23:30:09.000000000","message":"NIT: \"AutoReconnect\" \u003d\u003e \"ConnectionError\"","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":159,"context_line":""},{"line_number":160,"context_line":"                time.sleep(sleep_sec * (2 ** attempt))"},{"line_number":161,"context_line":"        else:"},{"line_number":162,"context_line":"            LOG.error(_(u\u0027Caught AutoReconnect, maximum attempts \u0027"},{"line_number":163,"context_line":"                        \u0027to {0} exceeded.\u0027).format(func))"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"            raise ex"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_46241060","line":162,"updated":"2014-07-22 23:30:09.000000000","message":"See above NIT.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":170,"context_line":"def reset_pipeline(func):"},{"line_number":171,"context_line":"    \"\"\"Reset pipeline."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        Methods using pipeline need to reset the pipeline"},{"line_number":174,"context_line":"        after usage."},{"line_number":175,"context_line":"    \"\"\""},{"line_number":176,"context_line":"    @functools.wraps(func)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_a61a4c16","line":173,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"def basic_message(msg, now):"},{"line_number":186,"context_line":"    # Note(prashanthr_): DRY."},{"line_number":187,"context_line":"    oid \u003d msg[\u0027id\u0027]"},{"line_number":188,"context_line":"    age \u003d now - int(msg[\u0027c.e\u0027])"},{"line_number":189,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_4956e3cf","line":186,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Should this be a TODO instead of a NOTE?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    \"\"\"Verifies if the current message is claimed."},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        This utility verifies in the current message"},{"line_number":204,"context_line":"        has been claimed."},{"line_number":205,"context_line":"        Used with message pagination while returning"},{"line_number":206,"context_line":"        claimed messages."}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_c969138e","line":203,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":211,"context_line":"def msg_echo_filter(message, client_uuid):"},{"line_number":212,"context_line":"    \"\"\"Verify if the message has been created by the client."},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"       This utility verifies in the current message"},{"line_number":215,"context_line":"       has the same client_uuid.Used with message pagination"},{"line_number":216,"context_line":"       while returning claimed messages."},{"line_number":217,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_e966d7ba","line":214,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":221,"context_line":"def get_hostport(uri):"},{"line_number":222,"context_line":"    \"\"\"Fetch host and port from the pools uri."},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        NOTE(prashanthr): Check up with sanitization of input"},{"line_number":225,"context_line":"        here."},{"line_number":226,"context_line":"    \"\"\""},{"line_number":227,"context_line":"    netloc \u003d six.moves.urllib.parse.urlparse(uri).netloc"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_09030bbf","line":224,"updated":"2014-07-22 23:30:09.000000000","message":"STYLE: Don\u0027t indent description paragraph.","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":259,"context_line":"    def next(self):"},{"line_number":260,"context_line":"        curr \u003d next(self.queue_iter)"},{"line_number":261,"context_line":"        queue \u003d self.client.hmget(curr,"},{"line_number":262,"context_line":"                                  [\u0027c\u0027, \u0027m\u0027])"},{"line_number":263,"context_line":"        return self.denormalizer(queue, curr)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_092a2b2f","line":262,"updated":"2014-07-22 23:30:09.000000000","message":"NIT: No need to put the second arg on it\u0027s own line","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":20,"context_line":"import redis"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from marconi.openstack.common.gettextutils import _"},{"line_number":24,"context_line":"from marconi.openstack.common import log as logging"},{"line_number":25,"context_line":"from marconi.queues.storage import errors"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_6521d89d","line":23,"updated":"2014-07-31 06:36:47.000000000","message":"it had been replace by marconi.i18n","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"b6078f56477f63b655d14f6fa335ba9610759c29","unresolved":false,"context_lines":[{"line_number":210,"context_line":"def msg_expired_filter(message, now):"},{"line_number":211,"context_line":"    \"\"\"Verify if the message is expired."},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"    TODO(prashanthr_): Implement this."},{"line_number":214,"context_line":"    \"\"\""},{"line_number":215,"context_line":"    expires_at \u003d int(message[\u0027e\u0027])"},{"line_number":216,"context_line":"    return expires_at \u003c now"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_3090fc41","line":213,"updated":"2014-07-31 07:17:26.000000000","message":"NIT: already implemented ,right?","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":10634,"name":"Peng Fei Wang","email":"wpf710@gmail.com","username":"wpf"},"change_message_id":"421008650da425275f82c7096f2ee14d6bfa63e6","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    TODO(prashanthr_): Implement this."},{"line_number":214,"context_line":"    \"\"\""},{"line_number":215,"context_line":"    expires_at \u003d int(message[\u0027e\u0027])"},{"line_number":216,"context_line":"    return expires_at \u003c now"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"def get_hostport(uri):"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_65a63811","line":216,"updated":"2014-07-31 06:36:47.000000000","message":"\u003c\u003d now","commit_id":"0ce4da87f8c59560526d7b6422bd60557d45ce19"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":39,"context_line":"def descope_queue_name(scoped_name):"},{"line_number":40,"context_line":"    \"\"\"Descope Queue name with \u0027.\u0027."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"   Returns the queue name from the scoped name"},{"line_number":43,"context_line":"   which is of the form project-id.queue-name"},{"line_number":44,"context_line":"    \"\"\""},{"line_number":45,"context_line":"    return scoped_name.split(\u0027.\u0027)[1]"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_d8dd1415","line":42,"updated":"2014-07-31 16:43:47.000000000","message":"STYLE: indent 4 spaces, not 3","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    return normalize_none_str(project) + \u0027.\u0027 + normalize_none_str(queue)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"# Generate aliases for similar functionality from the claims"},{"line_number":79,"context_line":"# controller."},{"line_number":80,"context_line":"scope_pool_catalogue \u003d scope_claim_messages \u003d scope_queue_name"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_78d8881e","line":78,"updated":"2014-07-31 16:43:47.000000000","message":"NIT: This comment could be reworded to be more clear. Also consider adding a NOTE prefix","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d497b1d4e3f807c7b6bf1aa4ac7071131c2b3fad","unresolved":false,"context_lines":[{"line_number":80,"context_line":"scope_pool_catalogue \u003d scope_claim_messages \u003d scope_queue_name"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def scope_messages_set(queue\u003dNone, project\u003dNone, message_suffix\u003d\u0027\u0027):"},{"line_number":84,"context_line":"    \"\"\"Scope messages set with \u0027.\u0027"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    Returns a scoped name for the list of messages in the form"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_3d6353de","line":83,"updated":"2014-08-01 00:06:41.000000000","message":"DOC: This name confused me at first. In the interest of self-documenting code, could you change the name to reflect the fact this is scoping not for the message themselves, but for the set of message IDs?","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    return normalize_none_str(project) + \u0027.\u0027 + normalize_none_str("},{"line_number":90,"context_line":"        queue) + \u0027.\u0027+message_suffix"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"# Generate aliases for similar functionality from the claims"},{"line_number":93,"context_line":"# and catalogue controllers."},{"line_number":94,"context_line":"scope_queue_catalogue \u003d scope_claims_set \u003d scope_messages_set"},{"line_number":95,"context_line":"scope_queue_index \u003d scope_claim_lock \u003d scope_messages_set"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_98d39c00","line":92,"updated":"2014-07-31 16:43:47.000000000","message":"NIT: This comment could be reworded to be more clear. Also consider adding a NOTE prefix","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"def msg_claimed_filter(message, now):"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    \"\"\"Verifies if the current message is claimed."},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    This utility verifies in the current message"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_58f02492","line":189,"updated":"2014-07-31 16:43:47.000000000","message":"NIT/STYLE: Extra blank line before docstring not needed to visually distinguish function signature","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    Used with message pagination while returning"},{"line_number":195,"context_line":"    claimed messages."},{"line_number":196,"context_line":"    \"\"\""},{"line_number":197,"context_line":"    return message[\u0027c\u0027] !\u003d \u0027None\u0027 and int(message[\u0027c.e\u0027]) \u003e\u003d now"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"def msg_echo_filter(message, client_uuid):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_78efa8b1","line":197,"updated":"2014-07-31 16:43:47.000000000","message":"NIT: Should be \u0027\u003e\u0027 instead of \u0027\u003e\u003d\u0027. See reasoning below for L216.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"de8c87d211b2592c606acbfbf99f123e0c09ced1","unresolved":false,"context_lines":[{"line_number":210,"context_line":"def msg_expired_filter(message, now):"},{"line_number":211,"context_line":"    \"\"\"Verify if the message is expired.\"\"\""},{"line_number":212,"context_line":"    expires_at \u003d int(message[\u0027e\u0027])"},{"line_number":213,"context_line":"    return expires_at \u003c\u003d now"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"def get_hostport(uri):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_98eabc9e","line":213,"updated":"2014-07-31 16:43:47.000000000","message":"NIT: Should be \"\u003c\u003d\" instead of just \"\u003c\". Consider this scenario:\n\nT \u003d 0\n\ncreated_at \u003d T\nTTL \u003d 1\n\nexpires_at \u003d created_at + TTL \u003d T + 1 \u003d 1\n\n\u003c1 second later\u003e\n\nnow \u003d T + 1 \u003d 1\nexpires_at \u003c now \u003d 1 \u003c 1 \u003d False\n\n...except 1 second has passed, so the message lived 1 second per TTL, and now can expire in peace and quiet. :)","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"}],"setup.cfg":[{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"f92dfbb12ac165cde6a164e5af8c149a5cf5a0d1","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    sqlite \u003d marconi.queues.storage.sqlalchemy.driver:DataDriver"},{"line_number":40,"context_line":"    sqlalchemy \u003d marconi.queues.storage.sqlalchemy.driver:DataDriver"},{"line_number":41,"context_line":"    mongodb \u003d marconi.queues.storage.mongodb.driver:DataDriver"},{"line_number":42,"context_line":"    redis \u003d marconi.queues.storage.redis.driver:DataDriver"},{"line_number":43,"context_line":"    faulty \u003d marconi.tests.faulty_storage:DataDriver"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"marconi.queues.control.storage \u003d"}],"source_content_type":"text/x-ttcn-cfg","patch_set":9,"id":"baada198_ec8a6563","line":42,"updated":"2014-07-22 23:30:09.000000000","message":"DSQ: If we are including redis as part of the official distribution, should we also add redis (and hiredis) to requirements.txt ?","commit_id":"bf0a920e760b19e310717f73d46eb9474731b9a1"}],"tests/unit/queues/storage/test_impl_redis.py":[{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"251b3a2246015634c0bf5788f7e26cbb6f84ec12","unresolved":false,"context_lines":[{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"@testing.requires_redis"},{"line_number":170,"context_line":"class RedisQueuesTest(testing.TestBase):"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    driver_class \u003d driver.DataDriver"},{"line_number":173,"context_line":"    config_file \u003d \u0027wsgi_redis.conf\u0027"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_5bc12c2e","line":170,"updated":"2014-07-30 17:02:50.000000000","message":"I think we should inherit from testing.QueueControllerTest here as it contains a bunch of tests to run for queues.","commit_id":"e6ff4a5b5e5b3483826cb9b473b7ea77fc7999c8"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"251b3a2246015634c0bf5788f7e26cbb6f84ec12","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"@testing.requires_redis"},{"line_number":211,"context_line":"class RedisMessagesTest(testing.TestBase):"},{"line_number":212,"context_line":"    driver_class \u003d driver.DataDriver"},{"line_number":213,"context_line":"    config_file \u003d \u0027wsgi_redis.conf\u0027"},{"line_number":214,"context_line":"    controller_class \u003d controllers.MessageController"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_dbe45ce2","line":211,"updated":"2014-07-30 17:02:50.000000000","message":"same here with testing.MessageControllerTest","commit_id":"e6ff4a5b5e5b3483826cb9b473b7ea77fc7999c8"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"251b3a2246015634c0bf5788f7e26cbb6f84ec12","unresolved":false,"context_lines":[{"line_number":253,"context_line":""},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"@testing.requires_redis"},{"line_number":256,"context_line":"class RedisClaimsTest(testing.TestBase):"},{"line_number":257,"context_line":"    driver_class \u003d driver.DataDriver"},{"line_number":258,"context_line":"    config_file \u003d \u0027wsgi_redis.conf\u0027"},{"line_number":259,"context_line":"    controller_class \u003d controllers.ClaimController"}],"source_content_type":"text/x-python","patch_set":11,"id":"baada198_1bf5f483","line":256,"updated":"2014-07-30 17:02:50.000000000","message":"and here","commit_id":"e6ff4a5b5e5b3483826cb9b473b7ea77fc7999c8"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"300929cc93434980c8768a76d00132efc606c8a0","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        self.assertEqual(num_calls, [self.redis_conf.max_reconnect_attempts])"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"@testing.requires_redis"},{"line_number":159,"context_line":"class RedisDriverTest(testing.TestBase):"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    config_file \u003d \u0027wsgi_redis.conf\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_127a15f0","line":158,"updated":"2014-07-31 12:16:00.000000000","message":"are these tests enabled on Jenkins?\nOn my local machine with MARCONI_TEST_REDIS set for last version of this patch, I have plenty of failing tests.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"3007887cd82869f2cb9e483a92f1764a71b87dc4","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        self.assertEqual(num_calls, [self.redis_conf.max_reconnect_attempts])"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"@testing.requires_redis"},{"line_number":159,"context_line":"class RedisDriverTest(testing.TestBase):"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    config_file \u003d \u0027wsgi_redis.conf\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_b743143e","line":158,"in_reply_to":"baada198_127a15f0","updated":"2014-08-01 03:39:06.000000000","message":"Yes there are plenty of them failing once i set MARCONI_TEST_REDIS. Thanks for this. I am fixing this now.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"300929cc93434980c8768a76d00132efc606c8a0","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        cache \u003d oslo_cache.get_cache()"},{"line_number":180,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":181,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":182,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def tearDown(self):"},{"line_number":185,"context_line":"        super(RedisQueuesTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_8dd52a49","line":182,"updated":"2014-07-31 12:16:00.000000000","message":"As it is tests for queues, QueueController should be already available in self.controller. It is created in parent setUp method.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"3007887cd82869f2cb9e483a92f1764a71b87dc4","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        cache \u003d oslo_cache.get_cache()"},{"line_number":180,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":181,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":182,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    def tearDown(self):"},{"line_number":185,"context_line":"        super(RedisQueuesTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_37270465","line":182,"in_reply_to":"baada198_8dd52a49","updated":"2014-08-01 03:39:06.000000000","message":"Thanks for this :) I have really shallow knowledge on the testing code part of marconi.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"300929cc93434980c8768a76d00132efc606c8a0","unresolved":false,"context_lines":[{"line_number":217,"context_line":"    def setUp(self):"},{"line_number":218,"context_line":"        super(RedisMessagesTest, self).setUp()"},{"line_number":219,"context_line":"        cache \u003d oslo_cache.get_cache()"},{"line_number":220,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":221,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":222,"context_line":"        self.msg_controller \u003d self.driver.message_controller"},{"line_number":223,"context_line":"        self.q_controller \u003d self.driver.queue_controller"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_f260410f","line":220,"updated":"2014-07-31 12:16:00.000000000","message":"you shouldn\u0027t create driver here, the base class does it for you.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"3007887cd82869f2cb9e483a92f1764a71b87dc4","unresolved":false,"context_lines":[{"line_number":217,"context_line":"    def setUp(self):"},{"line_number":218,"context_line":"        super(RedisMessagesTest, self).setUp()"},{"line_number":219,"context_line":"        cache \u003d oslo_cache.get_cache()"},{"line_number":220,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":221,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":222,"context_line":"        self.msg_controller \u003d self.driver.message_controller"},{"line_number":223,"context_line":"        self.q_controller \u003d self.driver.queue_controller"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_b764f4b3","line":220,"in_reply_to":"baada198_f260410f","updated":"2014-08-01 03:39:06.000000000","message":"Done","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"300929cc93434980c8768a76d00132efc606c8a0","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        cache \u003d oslo_cache.get_cache()"},{"line_number":220,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":221,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":222,"context_line":"        self.msg_controller \u003d self.driver.message_controller"},{"line_number":223,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_4da6b210","line":222,"updated":"2014-07-31 12:16:00.000000000","message":"As it tests for messages, MessageController should be already available in self.controller.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"3007887cd82869f2cb9e483a92f1764a71b87dc4","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        cache \u003d oslo_cache.get_cache()"},{"line_number":220,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":221,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":222,"context_line":"        self.msg_controller \u003d self.driver.message_controller"},{"line_number":223,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9769b08e","line":222,"in_reply_to":"baada198_4da6b210","updated":"2014-08-01 03:39:06.000000000","message":"Done","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"300929cc93434980c8768a76d00132efc606c8a0","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":266,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":267,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":268,"context_line":"        self.claim_controller \u003d self.driver.claim_controller"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def tearDown(self):"},{"line_number":271,"context_line":"        super(RedisClaimsTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_2d7a5e77","line":268,"updated":"2014-07-31 12:16:00.000000000","message":"Same here - ClaimController should be available in self.controller.","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"3007887cd82869f2cb9e483a92f1764a71b87dc4","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        self.driver \u003d driver.DataDriver(self.conf, cache)"},{"line_number":266,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":267,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":268,"context_line":"        self.claim_controller \u003d self.driver.claim_controller"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def tearDown(self):"},{"line_number":271,"context_line":"        super(RedisClaimsTest, self).tearDown()"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_776a5c83","line":268,"in_reply_to":"baada198_2d7a5e77","updated":"2014-08-01 03:39:06.000000000","message":"Done","commit_id":"4495bb8ce187711a060ba1c4f832168536b71587"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"29a55cfac9ee4a523ead16462fae8fda81a35f54","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def setUp(self):"},{"line_number":180,"context_line":"        super(RedisQueuesTest, self).setUp()"},{"line_number":181,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":182,"context_line":"        self.q_controller \u003d self.controller"},{"line_number":183,"context_line":"        self.msg_controller \u003d self.driver.message_controller"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_02bde702","line":182,"updated":"2014-08-12 10:42:57.000000000","message":"IMO: Maybe better to use self.controller instead of q_controller and self.q_controller in all methods? It is used that way in all tests.","commit_id":"7555872bff19bd6e1298b40c6b0b9816a31922ca"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"29a55cfac9ee4a523ead16462fae8fda81a35f54","unresolved":false,"context_lines":[{"line_number":213,"context_line":"                                                    \u0027cl\u0027, int)[0]"},{"line_number":214,"context_line":"        self.assertEqual(claimed, 10)"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_queue_count_on_bulk_delete(self):"},{"line_number":217,"context_line":"        queue_name \u003d \u0027test-queue\u0027"},{"line_number":218,"context_line":"        client_uuid \u003d uuid.uuid4()"},{"line_number":219,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_e279d330","line":216,"updated":"2014-08-12 10:42:57.000000000","message":"Maybe if this tests check smth, that tests from base don\u0027t check - it is better to move them there? in this case to base.QueueControllerTest - so they can be run for all drivers, not only for redis? As far as I can see, some of them definitely can be moved, since they don\u0027t use any internal to redis driver knowledge and just use public interface","commit_id":"7555872bff19bd6e1298b40c6b0b9816a31922ca"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"29a55cfac9ee4a523ead16462fae8fda81a35f54","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def setUp(self):"},{"line_number":295,"context_line":"        super(RedisMessagesTest, self).setUp()"},{"line_number":296,"context_line":"        self.connection \u003d self.driver.connection"},{"line_number":297,"context_line":"        self.msg_controller \u003d self.controller"},{"line_number":298,"context_line":"        self.q_controller \u003d self.driver.queue_controller"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def tearDown(self):"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_02440717","line":297,"updated":"2014-08-12 10:42:57.000000000","message":"IMO: same way, use self.controller for self.msg_controller?","commit_id":"7555872bff19bd6e1298b40c6b0b9816a31922ca"}],"zaqar/queues/storage/redis/claims.py":[{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"29a55cfac9ee4a523ead16462fae8fda81a35f54","unresolved":false,"context_lines":[{"line_number":68,"context_line":"           Method to retrieve a particular field from"},{"line_number":69,"context_line":"           the claims information."},{"line_number":70,"context_line":"        \"\"\""},{"line_number":71,"context_line":"        message \u003d self._client.hgetall(claim_id)"},{"line_number":72,"context_line":"        info \u003d []"},{"line_number":73,"context_line":"        if not isinstance(fields, list):"},{"line_number":74,"context_line":"            fields \u003d [fields]"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_679f9565","line":71,"updated":"2014-08-12 10:42:57.000000000","message":"shouldn\u0027t it be claim there instead of message?","commit_id":"7555872bff19bd6e1298b40c6b0b9816a31922ca"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"29a55cfac9ee4a523ead16462fae8fda81a35f54","unresolved":false,"context_lines":[{"line_number":89,"context_line":"            return False"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        # If the claim exists delete if it is expired"},{"line_number":92,"context_line":"        # and return False"},{"line_number":93,"context_line":"        c_expires \u003d self._get_claim_info(claim_id, \u0027e.g\u0027)[0]"},{"line_number":94,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":95,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_c732215c","line":92,"updated":"2014-08-12 10:42:57.000000000","message":"Is this comment right? It is said that claim should be deleted if it is expired before returning False, but in the code you only return False without any deletion.\n\nAlso the code below duplicate code of _is_claim_expired, maybe we could utilize it there?","commit_id":"7555872bff19bd6e1298b40c6b0b9816a31922ca"},{"author":{"_account_id":10777,"name":"Nataliia Uvarova","email":"grafinya.uvarova@gmail.com","username":"AAzza"},"change_message_id":"29a55cfac9ee4a523ead16462fae8fda81a35f54","unresolved":false,"context_lines":[{"line_number":177,"context_line":"        pipe.hmset(claim_id, claim_info)"},{"line_number":178,"context_line":"        pipe.execute()"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"        # Manual resetting required here."},{"line_number":181,"context_line":"        pipe.reset()"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        results \u003d self.message_ctrl._active(queue, project\u003dproject,"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_879669ed","line":180,"updated":"2014-08-12 10:42:57.000000000","message":"This comment should explains why reset is required.","commit_id":"7555872bff19bd6e1298b40c6b0b9816a31922ca"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class ClaimController(storage.Claim):"},{"line_number":35,"context_line":"    \"\"\"Implements claim resource operations using Redis."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    Redis Data Structures:"},{"line_number":38,"context_line":"    ---------------------"},{"line_number":39,"context_line":"    Claims list ( Redis Set ) contains claim ids"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_91caf9a1","line":37,"updated":"2014-08-13 04:54:58.000000000","message":"DOC: Can you also document the list of message IDs per claim ID?","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class ClaimController(storage.Claim):"},{"line_number":35,"context_line":"    \"\"\"Implements claim resource operations using Redis."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    Redis Data Structures:"},{"line_number":38,"context_line":"    ---------------------"},{"line_number":39,"context_line":"    Claims list ( Redis Set ) contains claim ids"},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_76255315","line":37,"in_reply_to":"baada198_91caf9a1","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"0796cb0adad0130a0e6e9ad8a99c477e1408db66","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        grace         -\u003e     g"},{"line_number":52,"context_line":"        id            -\u003e    id"},{"line_number":53,"context_line":"        claim         -\u003e     c"},{"line_number":54,"context_line":"        client uuid   -\u003e     u"},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":57,"context_line":"        super(ClaimController, self).__init__(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_49398d3f","line":54,"updated":"2014-08-13 11:30:46.000000000","message":"`e` is missing here","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self._unpacker \u003d functools.partial(msgpack.unpackb, encoding\u003d\u0027utf-8\u0027)"},{"line_number":63,"context_line":"        self.message_ctrl \u003d self.driver.message_controller"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _get_claim_info(self, claim_id, fields, transform\u003dint):"},{"line_number":66,"context_line":"        \"\"\"Get a field from the claim Info."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"           Method to retrieve a particular field from"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_0464ec4b","line":65,"updated":"2014-08-13 04:54:58.000000000","message":"DRY: This looks a lot like _get_queue_info. What do you think about factoring these out into the utils module as a mixin class?","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self._unpacker \u003d functools.partial(msgpack.unpackb, encoding\u003d\u0027utf-8\u0027)"},{"line_number":63,"context_line":"        self.message_ctrl \u003d self.driver.message_controller"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _get_claim_info(self, claim_id, fields, transform\u003dint):"},{"line_number":66,"context_line":"        \"\"\"Get a field from the claim Info."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"           Method to retrieve a particular field from"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_05586357","line":65,"in_reply_to":"baada198_0464ec4b","updated":"2014-08-13 14:07:17.000000000","message":"Sure. Makes a lot of sense.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        return tuple(info)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _exists(self, queue, claim_id, project):"},{"line_number":83,"context_line":"        # NOTE(prashanthr_) : Handle expired claims here."},{"line_number":84,"context_line":"        client \u003d self._client"},{"line_number":85,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":86,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_ff3781d9","line":83,"updated":"2014-08-13 04:54:58.000000000","message":"NIT: Relocate this comment to sit above L91","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        return tuple(info)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _exists(self, queue, claim_id, project):"},{"line_number":83,"context_line":"        # NOTE(prashanthr_) : Handle expired claims here."},{"line_number":84,"context_line":"        client \u003d self._client"},{"line_number":85,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":86,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_1636d74f","line":83,"in_reply_to":"baada198_ff3781d9","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def _exists(self, queue, claim_id, project):"},{"line_number":83,"context_line":"        # NOTE(prashanthr_) : Handle expired claims here."},{"line_number":84,"context_line":"        client \u003d self._client"},{"line_number":85,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":86,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"},{"line_number":87,"context_line":"        # Return False if no such claim exists"},{"line_number":88,"context_line":"        if not client.sismember(qclaims_set_id, claim_id):"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_24f6505f","line":85,"updated":"2014-08-13 04:54:58.000000000","message":"NIT: \"id\" \u003d\u003d\u003e \"key\"\n\nAlso, IMO you don\u0027t need the \u0027q\u0027 prefix in the name since it can be understood from the context of the surrounding code.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    def _exists(self, queue, claim_id, project):"},{"line_number":83,"context_line":"        # NOTE(prashanthr_) : Handle expired claims here."},{"line_number":84,"context_line":"        client \u003d self._client"},{"line_number":85,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":86,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"},{"line_number":87,"context_line":"        # Return False if no such claim exists"},{"line_number":88,"context_line":"        if not client.sismember(qclaims_set_id, claim_id):"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_00a931de","line":85,"in_reply_to":"baada198_24f6505f","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        if not client.sismember(qclaims_set_id, claim_id):"},{"line_number":89,"context_line":"            return False"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        c_expires \u003d self._get_claim_info(claim_id, \u0027e.g\u0027)[0]"},{"line_number":92,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        if now \u003e c_expires:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_a467c023","line":91,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: The claim expires at (creation + TTL). Grace only applies at the moment the claim is created, in that it is used to extend message lifetimes a little longer than the claim itself, so that another worker has a chance to reclaim messages once a different claim expires (perhaps due to a crashed worker). In other words, the field should be \u0027e\u0027 not \u0027e.g\u0027.\n\nNIT: No need for the \u0027c_\u0027 prefix, as the reader can see from the context that \u0027expires\u0027 refers to claim expiration.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        if not client.sismember(qclaims_set_id, claim_id):"},{"line_number":89,"context_line":"            return False"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        c_expires \u003d self._get_claim_info(claim_id, \u0027e.g\u0027)[0]"},{"line_number":92,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        if now \u003e c_expires:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_20bb9511","line":91,"in_reply_to":"baada198_a467c023","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                                               CLAIM_LOCK_SUFFIX)"},{"line_number":152,"context_line":"        msg_pack \u003d self._packer"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        claim_info \u003d {"},{"line_number":155,"context_line":"            \u0027id\u0027: claim_id,"},{"line_number":156,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":157,"context_line":"            \u0027g\u0027: grace,"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_7ffe1106","line":154,"updated":"2014-08-13 04:54:58.000000000","message":"DOC: Can you update the docstring for the class to match? The schema here is slightly different from what is documented toward the top of this file.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                                               CLAIM_LOCK_SUFFIX)"},{"line_number":152,"context_line":"        msg_pack \u003d self._packer"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        claim_info \u003d {"},{"line_number":155,"context_line":"            \u0027id\u0027: claim_id,"},{"line_number":156,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":157,"context_line":"            \u0027g\u0027: grace,"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_a036c5b1","line":154,"in_reply_to":"baada198_7ffe1106","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        claim_info \u003d {"},{"line_number":155,"context_line":"            \u0027id\u0027: claim_id,"},{"line_number":156,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":157,"context_line":"            \u0027g\u0027: grace,"},{"line_number":158,"context_line":"            \u0027e\u0027: now + ttl,"},{"line_number":159,"context_line":"            \u0027e.g\u0027: now + ttl + grace"},{"line_number":160,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_bf1fc959","line":157,"updated":"2014-08-13 04:54:58.000000000","message":"Q. Is the grace value ever used anywhere? If not, it doesn\u0027t need to be stored...","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        claim_info \u003d {"},{"line_number":155,"context_line":"            \u0027id\u0027: claim_id,"},{"line_number":156,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":157,"context_line":"            \u0027g\u0027: grace,"},{"line_number":158,"context_line":"            \u0027e\u0027: now + ttl,"},{"line_number":159,"context_line":"            \u0027e.g\u0027: now + ttl + grace"},{"line_number":160,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_00c85175","line":157,"in_reply_to":"baada198_bf1fc959","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":157,"context_line":"            \u0027g\u0027: grace,"},{"line_number":158,"context_line":"            \u0027e\u0027: now + ttl,"},{"line_number":159,"context_line":"            \u0027e.g\u0027: now + ttl + grace"},{"line_number":160,"context_line":"        }"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        # Create the claim and load the metadata information."}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_71bf25cb","line":159,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: This field does not need to be persisted.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":157,"context_line":"            \u0027g\u0027: grace,"},{"line_number":158,"context_line":"            \u0027e\u0027: now + ttl,"},{"line_number":159,"context_line":"            \u0027e.g\u0027: now + ttl + grace"},{"line_number":160,"context_line":"        }"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        # Create the claim and load the metadata information."}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_c0ae59a1","line":159,"in_reply_to":"baada198_71bf25cb","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                                            limit\u003dlimit)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        cursor \u003d next(results)"},{"line_number":177,"context_line":"        messages \u003d list(cursor)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        messages_list \u003d [self._unpacker(client.get(message[\u0027id\u0027]))"},{"line_number":180,"context_line":"                         for message in messages]"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_1f4355b1","line":177,"updated":"2014-08-13 04:54:58.000000000","message":"PERF: Rather than iterating over cursor twice, once by passing to list(), and again in the following list comprehension, I believe it would be better to simply iterate over cursor directly in the list comp, i.e.:\n\n    for message in cursor]","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":174,"context_line":"                                            limit\u003dlimit)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"        cursor \u003d next(results)"},{"line_number":177,"context_line":"        messages \u003d list(cursor)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        messages_list \u003d [self._unpacker(client.get(message[\u0027id\u0027]))"},{"line_number":180,"context_line":"                         for message in messages]"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_e0aa7d83","line":177,"in_reply_to":"baada198_1f4355b1","updated":"2014-08-13 14:07:17.000000000","message":"Done.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        cursor \u003d next(results)"},{"line_number":177,"context_line":"        messages \u003d list(cursor)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        messages_list \u003d [self._unpacker(client.get(message[\u0027id\u0027]))"},{"line_number":180,"context_line":"                         for message in messages]"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        if len(messages_list) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_5f730d1c","line":179,"updated":"2014-08-13 04:54:58.000000000","message":"STYLE: If L177 is removed, you may simply rename this variable to \"messages\"","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        messages_list \u003d [self._unpacker(client.get(message[\u0027id\u0027]))"},{"line_number":180,"context_line":"                         for message in messages]"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        if len(messages_list) \u003d\u003d 0:"},{"line_number":183,"context_line":"            return (None, iter([]))"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        for message in messages_list:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_ff630143","line":182,"updated":"2014-08-13 04:54:58.000000000","message":"STYLE/PERF: This is more idiomatic and should even perform a little better:\n\n    if not messages_list:","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        messages_list \u003d [self._unpacker(client.get(message[\u0027id\u0027]))"},{"line_number":180,"context_line":"                         for message in messages]"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"        if len(messages_list) \u003d\u003d 0:"},{"line_number":183,"context_line":"            return (None, iter([]))"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        for message in messages_list:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_54a6880e","line":182,"in_reply_to":"baada198_ff630143","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        for message in messages_list:"},{"line_number":186,"context_line":"            message[\u0027c\u0027] \u003d claim_id"},{"line_number":187,"context_line":"            message[\u0027c.e\u0027] \u003d now + ttl"},{"line_number":188,"context_line":"            if ttl + grace \u003e message[\u0027t\u0027]:"},{"line_number":189,"context_line":"                message[\u0027t\u0027] \u003d ttl + grace"},{"line_number":190,"context_line":"            pipe.rpush(claim_messages, message[\u0027id\u0027])"},{"line_number":191,"context_line":"            pipe.set(message[\u0027id\u0027], msg_pack(message))"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_1f8d15d5","line":188,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: This should actually check whether the message would expire before the claim itself does, plus the grace period. If so, it should update both the message\u0027s TTL *and* expiration fields. Note that these fields can be calculated once outside the loop, which improves readability and is slightly more performant:\n\n    claim_expires \u003d now + ttl\n    message_expires \u003d claim_expires + grace\n    message_ttl \u003d ttl + grace\n\n    if message[\u0027e\u0027] \u003c message_expires:\n        message[\u0027t\u0027] \u003d message_ttl\n        message[\u0027e\u0027] \u003d claim_expires\n\nP.S. - The grace calculations can be a little confusing and hard to test; we spent a fair amount of time discussing them when they were originally implemented. :p","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        for message in messages_list:"},{"line_number":186,"context_line":"            message[\u0027c\u0027] \u003d claim_id"},{"line_number":187,"context_line":"            message[\u0027c.e\u0027] \u003d now + ttl"},{"line_number":188,"context_line":"            if ttl + grace \u003e message[\u0027t\u0027]:"},{"line_number":189,"context_line":"                message[\u0027t\u0027] \u003d ttl + grace"},{"line_number":190,"context_line":"            pipe.rpush(claim_messages, message[\u0027id\u0027])"},{"line_number":191,"context_line":"            pipe.set(message[\u0027id\u0027], msg_pack(message))"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_147c1071","line":188,"in_reply_to":"baada198_1f8d15d5","updated":"2014-08-13 14:07:17.000000000","message":"Done. Yeah grace is slightly confusing.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            if ttl + grace \u003e message[\u0027t\u0027]:"},{"line_number":189,"context_line":"                message[\u0027t\u0027] \u003d ttl + grace"},{"line_number":190,"context_line":"            pipe.rpush(claim_messages, message[\u0027id\u0027])"},{"line_number":191,"context_line":"            pipe.set(message[\u0027id\u0027], msg_pack(message))"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # Update the claim id and claim expiration info"},{"line_number":194,"context_line":"        # for all the messages."}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_5145c142","line":191,"updated":"2014-08-13 04:54:58.000000000","message":"BUG/DSQ: There\u0027s a race condition here. Between getting the list of active messages (L173) and claiming each message (L191), another request to claim those same messages may have come in on a different process and/or webhead. Whichever pipe ends up executing last will clobber the other pipe, and both clients will think they have claimed the same messages.\n\nThe way this is handled in the mongo driver is by having a filter clause that won\u0027t apply the update unless the message is still not claimed. Since Redis does not support such semantics, we may have to use Lua to ensure that nothing else executes between getting the list of messages and subsequently claiming them. Another option would be to do some kind of locking involving a flag stored in Redis. \n\nPlease catch Alejandro, Flavio or myself on IRC if you\u0027d like to discuss...","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            if ttl + grace \u003e message[\u0027t\u0027]:"},{"line_number":189,"context_line":"                message[\u0027t\u0027] \u003d ttl + grace"},{"line_number":190,"context_line":"            pipe.rpush(claim_messages, message[\u0027id\u0027])"},{"line_number":191,"context_line":"            pipe.set(message[\u0027id\u0027], msg_pack(message))"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        # Update the claim id and claim expiration info"},{"line_number":194,"context_line":"        # for all the messages."}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_c3957c95","line":191,"in_reply_to":"baada198_5145c142","updated":"2014-08-13 14:07:17.000000000","message":"Sure. I would like to discuss further on this.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        # Update the claim id and claim expiration info"},{"line_number":194,"context_line":"        # for all the messages."},{"line_number":195,"context_line":"        # Lock used here to ensure atomicity of the operation."},{"line_number":196,"context_line":"        with lockutils.lock(claim_lock_id):"},{"line_number":197,"context_line":"            self.driver.queue_controller._inc_claimed(queue, project,"},{"line_number":198,"context_line":"                                                      len(messages_list))"},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_ffef81f8","line":196,"updated":"2014-08-13 04:54:58.000000000","message":"PERF/STYLE: If you make the method, _inc_claimed, handle atomicity itself, the caller doesn\u0027t have to remember to lock each time (DRY). Ideally you can squash _inc_claim into a single atomic redis operation (hincrby) so this happens without needing to lock in Python-land.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"0796cb0adad0130a0e6e9ad8a99c477e1408db66","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        # Update the claim id and claim expiration info"},{"line_number":194,"context_line":"        # for all the messages."},{"line_number":195,"context_line":"        # Lock used here to ensure atomicity of the operation."},{"line_number":196,"context_line":"        with lockutils.lock(claim_lock_id):"},{"line_number":197,"context_line":"            self.driver.queue_controller._inc_claimed(queue, project,"},{"line_number":198,"context_line":"                                                      len(messages_list))"},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_49834daa","line":196,"in_reply_to":"baada198_ffef81f8","updated":"2014-08-13 11:30:46.000000000","message":"BUG: In addition, I\u0027m not convinced a lock is actually needed. I mean, atomicity is definitely required but achieving it through a lock does not guarantee cross-workers atomicity. What happens if 2 separate nodes try to increment this number?","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        # Update the claim id and claim expiration info"},{"line_number":194,"context_line":"        # for all the messages."},{"line_number":195,"context_line":"        # Lock used here to ensure atomicity of the operation."},{"line_number":196,"context_line":"        with lockutils.lock(claim_lock_id):"},{"line_number":197,"context_line":"            self.driver.queue_controller._inc_claimed(queue, project,"},{"line_number":198,"context_line":"                                                      len(messages_list))"},{"line_number":199,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_e33600b3","line":196,"in_reply_to":"baada198_ffef81f8","updated":"2014-08-13 14:07:17.000000000","message":"I have made it a single hincrby operation.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        ids \u003d self._get_claimed_messages(claim_messages)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        claimed_msgs \u003d [self._unpacker(client.get(id))"},{"line_number":230,"context_line":"                        for id in ids]"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        claim_info \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_d152b1d9","line":229,"updated":"2014-08-13 04:54:58.000000000","message":"PERF: Rather than doing a bunch of individual requests to the backend, can we pipeline this?","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        ids \u003d self._get_claimed_messages(claim_messages)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        claimed_msgs \u003d [self._unpacker(client.get(id))"},{"line_number":230,"context_line":"                        for id in ids]"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        claim_info \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_60bbcdbe","line":229,"in_reply_to":"baada198_d152b1d9","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        claim_info \u003d {"},{"line_number":233,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":234,"context_line":"            \u0027g\u0027: grace,"},{"line_number":235,"context_line":"            \u0027e\u0027: expires,"},{"line_number":236,"context_line":"            \u0027e.g\u0027: expires + grace"},{"line_number":237,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_f1dc1548","line":234,"updated":"2014-08-13 04:54:58.000000000","message":"See previous note about persisting grace value...","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        claim_info \u003d {"},{"line_number":233,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":234,"context_line":"            \u0027g\u0027: grace,"},{"line_number":235,"context_line":"            \u0027e\u0027: expires,"},{"line_number":236,"context_line":"            \u0027e.g\u0027: expires + grace"},{"line_number":237,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_e098bd6b","line":234,"in_reply_to":"baada198_f1dc1548","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":233,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":234,"context_line":"            \u0027g\u0027: grace,"},{"line_number":235,"context_line":"            \u0027e\u0027: expires,"},{"line_number":236,"context_line":"            \u0027e.g\u0027: expires + grace"},{"line_number":237,"context_line":"        }"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        for claimed_msg in claimed_msgs:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_919bd978","line":236,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: This field does not need to be persisted.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":233,"context_line":"            \u0027t\u0027: ttl,"},{"line_number":234,"context_line":"            \u0027g\u0027: grace,"},{"line_number":235,"context_line":"            \u0027e\u0027: expires,"},{"line_number":236,"context_line":"            \u0027e.g\u0027: expires + grace"},{"line_number":237,"context_line":"        }"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        for claimed_msg in claimed_msgs:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_009db158","line":236,"in_reply_to":"baada198_919bd978","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        }"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        for claimed_msg in claimed_msgs:"},{"line_number":240,"context_line":"            claimed_msg[\u0027c.e\u0027] \u003d expires"},{"line_number":241,"context_line":"            pipe.set(claimed_msg[\u0027id\u0027], msg_pack(claimed_msg))"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        # Update the claim id and claim expiration info"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_f4f24304","line":240,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: Expiration should only be modified when the message would otherwise expire before the claim expiration + grace period. Also, ttl should be updated. It would be good to factor this logic out into a helper method and call from both this \"update\" method, and the \"create\" method (DRY).\n\nP.S. - There is a bug in the mongo driver too! See also: https://bugs.launchpad.net/marconi/+bug/1356184","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":237,"context_line":"        }"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        for claimed_msg in claimed_msgs:"},{"line_number":240,"context_line":"            claimed_msg[\u0027c.e\u0027] \u003d expires"},{"line_number":241,"context_line":"            pipe.set(claimed_msg[\u0027id\u0027], msg_pack(claimed_msg))"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        # Update the claim id and claim expiration info"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_d640df08","line":240,"in_reply_to":"baada198_f4f24304","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    @utils.retries_on_connection_error"},{"line_number":251,"context_line":"    @utils.reset_pipeline"},{"line_number":252,"context_line":"    def delete(self, queue, claim_id, project\u003dNone):"},{"line_number":253,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":254,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        # NOTE(prashanthr_): Return silently when the claim"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_d420df4d","line":253,"updated":"2014-08-13 04:54:58.000000000","message":"NIT: The \u0027q\u0027 prefix is unnecessary","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    @utils.retries_on_connection_error"},{"line_number":251,"context_line":"    @utils.reset_pipeline"},{"line_number":252,"context_line":"    def delete(self, queue, claim_id, project\u003dNone):"},{"line_number":253,"context_line":"        qclaims_set_id \u003d utils.scope_claims_set(queue, project,"},{"line_number":254,"context_line":"                                                QUEUE_CLAIMS_SUFFIX)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"        # NOTE(prashanthr_): Return silently when the claim"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_60782dc2","line":253,"in_reply_to":"baada198_d420df4d","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        claim_messages \u003d utils.scope_claim_messages(claim_id,"},{"line_number":267,"context_line":"                                                    CLAIM_MESSAGES_SUFFIX)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        ids \u003d self._get_claimed_messages(claim_messages)"},{"line_number":270,"context_line":"        claimed_msgs \u003d []"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        for id in ids:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_d43b7f99","line":269,"updated":"2014-08-13 04:54:58.000000000","message":"NIT: The name of this function is a little misleading; it isn\u0027t getting messages per se, but rather message IDs.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        claim_messages \u003d utils.scope_claim_messages(claim_id,"},{"line_number":267,"context_line":"                                                    CLAIM_MESSAGES_SUFFIX)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        ids \u003d self._get_claimed_messages(claim_messages)"},{"line_number":270,"context_line":"        claimed_msgs \u003d []"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        for id in ids:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_20039512","line":269,"in_reply_to":"baada198_d43b7f99","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        claimed_msgs \u003d []"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        for id in ids:"},{"line_number":273,"context_line":"            msg \u003d client.get(id)"},{"line_number":274,"context_line":"            if msg:"},{"line_number":275,"context_line":"                claimed_msgs.append(self._unpacker(msg))"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_f457a3c7","line":273,"updated":"2014-08-13 04:54:58.000000000","message":"PERF: How about pipelining these get\u0027s so the client only needs to make a single round trip over the network?","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        claimed_msgs \u003d []"},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"        for id in ids:"},{"line_number":273,"context_line":"            msg \u003d client.get(id)"},{"line_number":274,"context_line":"            if msg:"},{"line_number":275,"context_line":"                claimed_msgs.append(self._unpacker(msg))"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_40008903","line":273,"in_reply_to":"baada198_f457a3c7","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":285,"context_line":"            claimed_msg[\u0027c.e\u0027] \u003d now"},{"line_number":286,"context_line":"            pipe.set(claimed_msg[\u0027id\u0027], msg_pack(claimed_msg))"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        pipe.execute()"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_3fe819df","line":288,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: The count of claimed messages was never decremented.\n\nTEST: Please add a test to verify this bug exists, and then to ensure it is fixed. Thanks! :)","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":285,"context_line":"            claimed_msg[\u0027c.e\u0027] \u003d now"},{"line_number":286,"context_line":"            pipe.set(claimed_msg[\u0027id\u0027], msg_pack(claimed_msg))"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"        pipe.execute()"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_db6d6acd","line":288,"in_reply_to":"baada198_3fe819df","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"36d6aeea9a82c24a0f9997fdf8e5f8cbcac936a3","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            message.add_to_pipeline(pipe)"},{"line_number":200,"context_line":"            basic_messages.append(basic_message(message))"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        pipe.execute()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        self.driver.queue_controller._inc_claimed(queue, project,"},{"line_number":205,"context_line":"                                                  len(msgs))"}],"source_content_type":"text/x-python","patch_set":19,"id":"1abeadc6_4d484687","line":202,"updated":"2014-08-21 04:20:11.000000000","message":"BUG: Still looks like there\u0027s a race condition here... The list of messages that were \"active\" after process A executes L175 may have been subsequently claimed by a parallel request handled by process B, before process A arrives at L202.","commit_id":"fdebc4b3ab9c93c67a1537566f638fd88251eed5"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"71e6f4d82a9cd57377b37150d430f34035bf5475","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            message.add_to_pipeline(pipe)"},{"line_number":200,"context_line":"            basic_messages.append(basic_message(message))"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        pipe.execute()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        self.driver.queue_controller._inc_claimed(queue, project,"},{"line_number":205,"context_line":"                                                  len(msgs))"}],"source_content_type":"text/x-python","patch_set":19,"id":"1abeadc6_60c31638","line":202,"in_reply_to":"1abeadc6_4d484687","updated":"2014-08-22 10:10:00.000000000","message":"This one is harder to solve without either a better query dsl in the storage or a distributed lock.\n\nA dirty hack could be to add the ids of the active messages returned in L175 into a redis set. If process B tries to add an ID to this temp set and the id already exists, it means it\u0027s already being claimed by process A, therefore process B cannot claim it and the message should be skipped. At the end of the claim process, these ids should be cleared from the temporary set.\n\nThis adds 2 more steps to the pipeline but at least it doesn\u0027t add a dependency on a distributed lock or other magical things.\n\nThoughts?","commit_id":"fdebc4b3ab9c93c67a1537566f638fd88251eed5"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"d962bc401d1b1c77bc18993d3078c7796c502fbb","unresolved":false,"context_lines":[{"line_number":199,"context_line":"            message.add_to_pipeline(pipe)"},{"line_number":200,"context_line":"            basic_messages.append(basic_message(message))"},{"line_number":201,"context_line":""},{"line_number":202,"context_line":"        pipe.execute()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        self.driver.queue_controller._inc_claimed(queue, project,"},{"line_number":205,"context_line":"                                                  len(msgs))"}],"source_content_type":"text/x-python","patch_set":19,"id":"1abeadc6_fff4ddd0","line":202,"in_reply_to":"1abeadc6_60c31638","updated":"2014-08-26 21:44:17.000000000","message":"That could work. Taking the \"better query dsl\" approach, I think you could write a Lua function that checks each message hasn\u0027t been claimed before updating it. If no messages are claimed at the end, I guess the python create() function could retry for another batch.\n\nParams the lua script would need:\n\n  * claim_id\n  * claim_expires\n  * msg_ttl\n  * msg_expires\n  * List of message IDs to claim\n  * Name of \"claim messages\" set","commit_id":"fdebc4b3ab9c93c67a1537566f638fd88251eed5"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"936d002a4a9efd5e478459b566e42479b71de1b1","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        return self.driver.queue_controller"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @decorators.lazy_property(write\u003dFalse)"},{"line_number":108,"context_line":"    def _pipeline(self):"},{"line_number":109,"context_line":"        return self._client.pipeline()"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_f07ef0ad","line":108,"updated":"2014-08-30 07:39:11.000000000","message":"Is it to \"expensive\" to create a pipeline everytime? Is keeping the pipeline around and resetting it the recommended thing to do?\n\nWe could probably just call `self.client.pipeline()` when the pipeline is needed and avoid using the decorator or resetting it manually.\n\nBUG(?): Actually, one more thought. Is re-using the pipeline thread-safe? What happens if it is reset when another process is still using it?","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"7d32e2d8e105ab7cfe28d7922f094998d8ea6bc6","unresolved":false,"context_lines":[{"line_number":105,"context_line":"        return self.driver.queue_controller"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @decorators.lazy_property(write\u003dFalse)"},{"line_number":108,"context_line":"    def _pipeline(self):"},{"line_number":109,"context_line":"        return self._client.pipeline()"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_cdab1ad4","line":108,"in_reply_to":"1abeadc6_f07ef0ad","updated":"2014-08-30 13:32:12.000000000","message":"Good point; the docs actually encourage using pipe instances as context managers or via the \"transaction\" helper with a callback, which would seem to imply that pipelines are expected to be short-lived. \n\nI will go ahead and make the change.","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"936d002a4a9efd5e478459b566e42479b71de1b1","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            basic_messages \u003d []"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"            try:"},{"line_number":199,"context_line":"                # TODO(kgriffs): Is it faster/better to do this all"},{"line_number":200,"context_line":"                # in a Lua script instead?"},{"line_number":201,"context_line":"                pipe.watch(counter_key)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_bb145944","line":198,"updated":"2014-08-30 07:39:11.000000000","message":"I think I follow pretty much all that\u0027s happening here. However, it would be nice if you could add a comment describing exactly the algorithm for claims in this driver.","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"7d32e2d8e105ab7cfe28d7922f094998d8ea6bc6","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            basic_messages \u003d []"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"            try:"},{"line_number":199,"context_line":"                # TODO(kgriffs): Is it faster/better to do this all"},{"line_number":200,"context_line":"                # in a Lua script instead?"},{"line_number":201,"context_line":"                pipe.watch(counter_key)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_4d870a61","line":198,"in_reply_to":"1abeadc6_bb145944","updated":"2014-08-30 13:32:12.000000000","message":"Sure thing","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"936d002a4a9efd5e478459b566e42479b71de1b1","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            try:"},{"line_number":199,"context_line":"                # TODO(kgriffs): Is it faster/better to do this all"},{"line_number":200,"context_line":"                # in a Lua script instead?"},{"line_number":201,"context_line":"                pipe.watch(counter_key)"},{"line_number":202,"context_line":"                pipe.multi()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"                now \u003d timeutils.utcnow_ts()"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_7ba3a1ff","line":201,"updated":"2014-08-30 07:39:11.000000000","message":"I guess, just like in mongodb\u0027s driver, this makes claims a best effort action. IIUC, if another process changes the counter_key, this one will raise a `WatchError`.\n\nCan this exception be raised while the transaction below is being executed? If so, should we return `basic_messages` with the few claimed messages?","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"7d32e2d8e105ab7cfe28d7922f094998d8ea6bc6","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            try:"},{"line_number":199,"context_line":"                # TODO(kgriffs): Is it faster/better to do this all"},{"line_number":200,"context_line":"                # in a Lua script instead?"},{"line_number":201,"context_line":"                pipe.watch(counter_key)"},{"line_number":202,"context_line":"                pipe.multi()"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"                now \u003d timeutils.utcnow_ts()"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_8df4c2f1","line":201,"in_reply_to":"1abeadc6_7ba3a1ff","updated":"2014-08-30 13:32:12.000000000","message":"If a different request increments the claimed counter before we get to line 226 and execute the transaction (which is entered at L202), the entire transaction will be aboted and WatchError is raised. \n\nFurthermore, Redis serializes transactions, so another request could never result in two transactions being interleaved.\n\nTherefore, it is not possible for a subset of the messages to be persisted (all or nothing).\n\nSee also: http://redis.io/topics/transactions\n\nP.S. - There is a note in the above docs about transactions perhaps becoming deprecated at some point, and that Lua is often faster and simpler. I have it on the TODO list to investigate that approach and\nbenchmark.","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"}],"zaqar/queues/storage/redis/message.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"936d002a4a9efd5e478459b566e42479b71de1b1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Prashanth Raghu."},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_fbb6d13c","line":1,"updated":"2014-08-30 07:39:11.000000000","message":"NIT: It\u0027d have been better to call this file `models` or `objects`. It\u0027s quite confusing since we also have `messages`.\n\nNothing we should worry about right now.","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"7d32e2d8e105ab7cfe28d7922f094998d8ea6bc6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 Prashanth Raghu."},{"line_number":2,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":3,"context_line":"# you may not use this file except in compliance with the License."},{"line_number":4,"context_line":"# You may obtain a copy of the License at"}],"source_content_type":"text/x-python","patch_set":22,"id":"1abeadc6_addede6a","line":1,"in_reply_to":"1abeadc6_fbb6d13c","updated":"2014-08-30 13:32:12.000000000","message":"I\u0027ll go ahead and change it now since I\u0027ve got a few other things to do anyway.","commit_id":"b45e2b83b475de37a98b0381707a3759c4b64755"}],"zaqar/queues/storage/redis/messages.py":[{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        self._client \u003d self.driver.connection"},{"line_number":70,"context_line":"        self._init_pipeline()"},{"line_number":71,"context_line":"        self._scripts \u003d self._init_scripts()"},{"line_number":72,"context_line":"        self._packer \u003d functools.partial(msgpack.packb, use_bin_type\u003dTrue)"},{"line_number":73,"context_line":"        self._unpacker \u003d functools.partial(msgpack.unpackb, encoding\u003d\u0027utf-8\u0027)"},{"line_number":74,"context_line":"        self._queue_controller \u003d self.driver.queue_controller"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_c2906c44","line":72,"updated":"2014-08-11 18:19:49.000000000","message":"PERF: Same issue as with self._unpacker (see below)","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        self._init_pipeline()"},{"line_number":71,"context_line":"        self._scripts \u003d self._init_scripts()"},{"line_number":72,"context_line":"        self._packer \u003d functools.partial(msgpack.packb, use_bin_type\u003dTrue)"},{"line_number":73,"context_line":"        self._unpacker \u003d functools.partial(msgpack.unpackb, encoding\u003d\u0027utf-8\u0027)"},{"line_number":74,"context_line":"        self._queue_controller \u003d self.driver.queue_controller"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def _init_scripts(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_227a0825","line":73,"updated":"2014-08-11 18:19:49.000000000","message":"PERF: It is better to instantiate the class msgpack.Unpacker rather than doing a partial on unpackb; the latter will instantiate Unpacker each time it is called, so by using the class directly you can save a few CPU cycles.","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        Will be referenced from the QueueController."},{"line_number":135,"context_line":"        The pipe to execute deletion will be passed from the QueueController"},{"line_number":136,"context_line":"        executing the operation."},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        \"\"\""},{"line_number":139,"context_line":"        client \u003d self._client"},{"line_number":140,"context_line":"        messages_set_key \u003d utils.scope_message_ids_set(queue, project,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_3cccee33","line":137,"updated":"2014-08-11 18:19:49.000000000","message":"NIT/STYLE: Remove blank line (L137)","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def _get_first_message_id(self, queue, project, sort):"},{"line_number":180,"context_line":"        \"\"\"Fetch head/tail of the Queue."},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"           Helper function to get the first message in the queue"},{"line_number":183,"context_line":"           sort \u003e 0 get from the left else from the right."},{"line_number":184,"context_line":"        \"\"\""},{"line_number":185,"context_line":"        messages_set_key \u003d utils.scope_message_ids_set(queue, project,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_dcf13265","line":182,"updated":"2014-08-11 18:19:49.000000000","message":"STYLE: Don\u0027t indent description (should line up with first quote mark in \"\"\", above.","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"        # NOTE(prashanthr_): Iterate through the queue to find the first"},{"line_number":217,"context_line":"        # unclaimed message."},{"line_number":218,"context_line":"        if not marker and not include_claimed:"},{"line_number":219,"context_line":"            marker \u003d self._find_first_unclaimed(queue, project, limit)"},{"line_number":220,"context_line":"            start \u003d client.zrank(messages_set_key, marker) or 0"},{"line_number":221,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_a280d849","line":218,"updated":"2014-08-11 18:19:49.000000000","message":"BUG: What about the case when a marker is given, and yet include_claimed is still false? Don\u0027t we want to still filter out claimed messages that are ranked after the given marker?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            marker \u003d self._find_first_unclaimed(queue, project, limit)"},{"line_number":220,"context_line":"            start \u003d client.zrank(messages_set_key, marker) or 0"},{"line_number":221,"context_line":"        else:"},{"line_number":222,"context_line":"            rank \u003d client.zrank(messages_set_key, marker)"},{"line_number":223,"context_line":"            start \u003d rank + 1 if rank else 0"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        message_ids \u003d client.zrange(messages_set_key, start,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_82291485","line":222,"updated":"2014-08-11 18:19:49.000000000","message":"Q. What happens if marker is None and include_claimed is True? Does the zrank function handle None being passed for the marker?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":253,"context_line":"            for msg_id in msg_ids:"},{"line_number":254,"context_line":"                pipe.get(msg_id)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"            msgs \u003d pipe.execute()"},{"line_number":257,"context_line":"            msgs_unpacked \u003d [self._unpacker(msg) for msg in msgs]"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"            for message in msgs_unpacked:"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_a29ff863","line":256,"updated":"2014-08-11 18:19:49.000000000","message":"Q. What happens if one of the messages is missing (was deleted between after L225, but before L256). Will this cause any problems that need to be mitigated?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            for message in msgs_unpacked:"},{"line_number":260,"context_line":"                if message:"},{"line_number":261,"context_line":"                    for filter in six.itervalues(filters):"},{"line_number":262,"context_line":"                        filter_func \u003d filter[\u0027f\u0027]"},{"line_number":263,"context_line":"                        if filter_func(message):"},{"line_number":264,"context_line":"                            break"},{"line_number":265,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_c22dcc46","line":262,"updated":"2014-08-11 18:19:49.000000000","message":"NIT: You could avoid this extra lookup by simply assigning the filter directly as the value,  e.g., filters[\u0027echo\u0027] \u003d functools.partial(...)","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        return utils.basic_message(self._get(message_id[0]), now,"},{"line_number":286,"context_line":"                                   add_created\u003dTrue)"},{"line_number":287,"context_line":""},{"line_number":288,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_e27d70e7","line":285,"updated":"2014-08-11 18:19:49.000000000","message":"Q. Why is message_id an array? In other words, why do you have to index into it to get the \"actualy\" ID, i.e.: \n\n    message_id[0]","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        msg \u003d self._get(message_id)"},{"line_number":296,"context_line":"        now \u003d timeutils.utcnow_ts()"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        if msg and not utils.msg_expired_filter(msg, now):"},{"line_number":299,"context_line":"            return utils.basic_message(msg, timeutils.utcnow_ts())"},{"line_number":300,"context_line":"        else:"},{"line_number":301,"context_line":"            raise errors.MessageDoesNotExist(message_id, queue, project)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_22520868","line":298,"updated":"2014-08-11 18:19:49.000000000","message":"KUDO: Nice use of the filter here to test expiration in a DRY manner.","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        prepared_messages \u003d ["},{"line_number":346,"context_line":"            {"},{"line_number":347,"context_line":"                \u0027id\u0027: utils.generate_uuid(),"},{"line_number":348,"context_line":"                \u0027cr_iso\u0027: str(datetime.datetime.utcfromtimestamp(now)),"},{"line_number":349,"context_line":"                \u0027t\u0027: message[\u0027ttl\u0027],"},{"line_number":350,"context_line":"                \u0027e\u0027: now + message[\u0027ttl\u0027],"},{"line_number":351,"context_line":"                \u0027u\u0027: str(client_uuid),"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_a248d88a","line":348,"updated":"2014-08-11 18:19:49.000000000","message":"Q. What is the purpose of this field? Why is it a string rather than a unix timestamp?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":348,"context_line":"                \u0027cr_iso\u0027: str(datetime.datetime.utcfromtimestamp(now)),"},{"line_number":349,"context_line":"                \u0027t\u0027: message[\u0027ttl\u0027],"},{"line_number":350,"context_line":"                \u0027e\u0027: now + message[\u0027ttl\u0027],"},{"line_number":351,"context_line":"                \u0027u\u0027: str(client_uuid),"},{"line_number":352,"context_line":"                \u0027cr\u0027: now,"},{"line_number":353,"context_line":"                \u0027c\u0027: None,"},{"line_number":354,"context_line":"                \u0027c.e\u0027: now,"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_0507ce17","line":351,"updated":"2014-08-11 18:19:49.000000000","message":"PERF: Can we use the binary UUID here to save space in RAM and perhaps save some cycles by not having to do the str conversion?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":379,"context_line":"            raise errors.QueueDoesNotExist(queue,"},{"line_number":380,"context_line":"                                           project)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"        # NOTE(prashanthr_): Return silently if the claim does not exist"},{"line_number":383,"context_line":"        if claim and not self.driver.claim_controller._exists(queue,"},{"line_number":384,"context_line":"                                                              claim, project):"},{"line_number":385,"context_line":"            raise storage.errors.NotPermitted()"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_c55f96e2","line":382,"updated":"2014-08-11 18:19:49.000000000","message":"Is this comment correct?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":403,"context_line":"            if msg_claim !\u003d claim:"},{"line_number":404,"context_line":"                raise errors.MessageIsClaimedBy(message_id, claim)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"        pipe.delete(message_id).zrem(messages_set_key, message_id).execute()"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    @utils.raises_conn_error"},{"line_number":409,"context_line":"    @utils.retries_on_connection_error"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_85e75ed6","line":406,"updated":"2014-08-11 18:19:49.000000000","message":"BUG: Seems like the counter in the queue hash should be decremented as well? Otherwise, queue stats will be incorrect. If this is correct, please also add a test to verify the fix.","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        pipe \u003d self._pipeline"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        for message_id in message_ids:"},{"line_number":421,"context_line":"            pipe.delete(message_id).zrem(messages_set_key, message_id)"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"        pipe.execute()"},{"line_number":424,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_45f1c694","line":421,"updated":"2014-08-11 18:19:49.000000000","message":"BUG: Seems like the counter in the queue hash should be decremented as well? Otherwise, queue stats will be incorrect. If this is correct, please also add a test to verify the fix.","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        message_ids \u003d [message[\u0027id\u0027] for message in messages]"},{"line_number":437,"context_line":"        self.bulk_delete(queue, message_ids, project)"},{"line_number":438,"context_line":"        # NOTE(prashanthr_): Creating a claim controller reference"},{"line_number":439,"context_line":"        # causes a recursive reference. Hence, using the reference"},{"line_number":440,"context_line":"        # from the driver."},{"line_number":441,"context_line":"        self.driver.claim_controller.delete(queue, claim_id, project)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_856cbe34","line":438,"updated":"2014-08-11 18:19:49.000000000","message":"FYI: If you would like to remove one layer of indirection, you can just copy claim_controller in your __init__ like so:\n\nself._claim_controller \u003d self.driver.claim_controller","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"06df5438307a96c0e8d2296211e1c4a9be152495","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            msgs_unpacked \u003d []"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"            for msg in msgs:"},{"line_number":270,"context_line":"                self._unpacker.feed(msg)"},{"line_number":271,"context_line":"                msg_unpack \u003d self._unpacker.unpack()"},{"line_number":272,"context_line":"                # NOTE(prashanthr_):None Check is done to ensure that messages"},{"line_number":273,"context_line":"                # deleted before the execution of the pipeline do not raise"}],"source_content_type":"text/x-python","patch_set":17,"id":"baada198_bba8da21","line":270,"updated":"2014-08-12 15:42:51.000000000","message":"PERF: Sorry, I led you astray. I just did a test and while Packer is faster than using msgpack.packb, Unpacker is actually *slower* than using msgpack.unpackb. So, I think we can keep using the Packer object, but should revert to using msgpack.unpackb here. :p","commit_id":"fb94c0434b24fd764132bb7124fe216b29189c30"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        # NOTE(prashanthr_): results[0] is 1 when the delete is"},{"line_number":421,"context_line":"        # successful. Hence we use that case to identify successful"},{"line_number":422,"context_line":"        # deletes."},{"line_number":423,"context_line":"        self._queue_controller._inc_counter(queue, project,"},{"line_number":424,"context_line":"                                            -1 if results[0] else 0)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_7fa0d1a4","line":423,"updated":"2014-08-13 04:54:58.000000000","message":"BUG: If the message is claimed, the total number of claimed messages must also be decremented.\n\nTEST: Please add a test to verify this bug exists, and then to ensure it is fixed. Thanks! :)","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        # NOTE(prashanthr_): results[0] is 1 when the delete is"},{"line_number":421,"context_line":"        # successful. Hence we use that case to identify successful"},{"line_number":422,"context_line":"        # deletes."},{"line_number":423,"context_line":"        self._queue_controller._inc_counter(queue, project,"},{"line_number":424,"context_line":"                                            -1 if results[0] else 0)"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @utils.raises_conn_error"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_059dc358","line":423,"in_reply_to":"baada198_7fa0d1a4","updated":"2014-08-13 14:07:17.000000000","message":"Thanks for this :). Sure will do that. Will also do the same in bulk delete as well.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"}],"zaqar/queues/storage/redis/queues.py":[{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def _inc_counter(self, name, project, amount\u003d1):"},{"line_number":72,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":73,"context_line":"        count \u003d self._get_queue_info(q_id, \u0027c\u0027, int)[0]"},{"line_number":74,"context_line":"        self._set_counter(q_id, count + amount)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def _set_counter(self, q_id, count):"},{"line_number":77,"context_line":"        q_info \u003d {"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_65becab0","line":74,"updated":"2014-08-11 18:19:49.000000000","message":"PERF: Is it possible to use HINCRBY here, rather than having to perform two separate operations (get, set)?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _inc_counter(self, name, project, amount\u003d1):"},{"line_number":73,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":74,"context_line":"        self._client.hincrby(q_id, \u0027c\u0027, int(amount))"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def _inc_claimed(self, name, project, amount\u003d1):"},{"line_number":77,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_5fca2da4","line":74,"updated":"2014-08-13 04:54:58.000000000","message":"Q. When will amount ever be passed in as anything other than an int type? Conceptually, it seems like this should be part of the method\u0027s contract, and could even be asserted if you want to be sure.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def _inc_counter(self, name, project, amount\u003d1):"},{"line_number":73,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":74,"context_line":"        self._client.hincrby(q_id, \u0027c\u0027, int(amount))"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def _inc_claimed(self, name, project, amount\u003d1):"},{"line_number":77,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_85447377","line":74,"in_reply_to":"baada198_5fca2da4","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"3369f3d82a3efd58b68d41c69ecc51925f27722b","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def _inc_claimed(self, name, project, amount\u003d1):"},{"line_number":77,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":78,"context_line":"        cl_count \u003d self._get_queue_info(q_id, \u0027cl\u0027, int)[0]"},{"line_number":79,"context_line":"        self._set_claim_counter(q_id, cl_count + amount)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _set_claim_counter(self, q_id, count):"},{"line_number":82,"context_line":"        q_info \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_7f3611b5","line":79,"updated":"2014-08-13 04:54:58.000000000","message":"PERF: How about using hincrby here?","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"0796cb0adad0130a0e6e9ad8a99c477e1408db66","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def _inc_claimed(self, name, project, amount\u003d1):"},{"line_number":77,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":78,"context_line":"        cl_count \u003d self._get_queue_info(q_id, \u0027cl\u0027, int)[0]"},{"line_number":79,"context_line":"        self._set_claim_counter(q_id, cl_count + amount)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _set_claim_counter(self, q_id, count):"},{"line_number":82,"context_line":"        q_info \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_8952c534","line":79,"in_reply_to":"baada198_7f3611b5","updated":"2014-08-13 11:30:46.000000000","message":"BUG: +1 to kurt\u0027s suggestion. As mentioned in the `claims` module, I think this method is not atomic and the counter will go crazy when there will be more than 1 zaqar node.","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"},{"author":{"_account_id":10812,"name":"Prashanth Raghu","email":"p.isprashanth@gmail.com","username":"prashanthr"},"change_message_id":"96eb0b6d962ab177ea786c6fc5b1d80b1d6a131d","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def _inc_claimed(self, name, project, amount\u003d1):"},{"line_number":77,"context_line":"        q_id \u003d utils.scope_queue_name(name, project)"},{"line_number":78,"context_line":"        cl_count \u003d self._get_queue_info(q_id, \u0027cl\u0027, int)[0]"},{"line_number":79,"context_line":"        self._set_claim_counter(q_id, cl_count + amount)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    def _set_claim_counter(self, q_id, count):"},{"line_number":82,"context_line":"        q_info \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_65783fc2","line":79,"in_reply_to":"baada198_7f3611b5","updated":"2014-08-13 14:07:17.000000000","message":"Done","commit_id":"dad3cc5d645fae248acd58c6c75a59a68c1fc9fa"}],"zaqar/queues/storage/redis/utils.py":[{"author":{"_account_id":6427,"name":"Kurt Griffiths","email":"kurt.griffiths@rackspace.com","username":"kgriffs"},"change_message_id":"85254ac2658bcd64ade4e587f24148c6aade69fb","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def generate_uuid():"},{"line_number":61,"context_line":"    return uuid.uuid4().hex"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"def scope_queue_name(queue\u003dNone, project\u003dNone):"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_a54b825d","line":61,"updated":"2014-08-11 18:19:49.000000000","message":"PERF: Can we use the binary UUID instead of hex string to save some RAM and perhaps avoid conversions in some cases to save CPU time?","commit_id":"cdfda3f3c99206343fe75087764a91343e940391"}]}
