)]}'
{"marconi/storage/mongodb/claims.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"bbccc1fa734397581463777d712e387cea9fb8d4","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        ttl_delta \u003d datetime.timedelta(seconds\u003dttl)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        expires \u003d now + ttl_delta"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        msg_ctrl \u003d self.driver.message_controller"},{"line_number":200,"context_line":"        claimed \u003d msg_ctrl.claimed(queue, cid, expires\u003dnow,"},{"line_number":201,"context_line":"                                   limit\u003d1, project\u003dproject)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4dQ%3D","line":198,"updated":"2013-08-15 19:30:43.000000000","message":"Could you comment here \"# NOTE\"-style why it\u0027s safe to remove this check/raise?","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"e1dbfe5ca63feaa34d59551f7c7d2c2172fb86db","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        ttl_delta \u003d datetime.timedelta(seconds\u003dttl)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        expires \u003d now + ttl_delta"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        msg_ctrl \u003d self.driver.message_controller"},{"line_number":200,"context_line":"        claimed \u003d msg_ctrl.claimed(queue, cid, expires\u003dnow,"},{"line_number":201,"context_line":"                                   limit\u003d1, project\u003dproject)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4VA%3D","line":198,"in_reply_to":"AAAARH%2F%2F4bc%3D","updated":"2013-08-15 20:05:41.000000000","message":"Wait, I think I understand now. You\u0027re saying that the reason this can be removed safely is that the only times \"now \u003e expires\" is when a negative TTL is supplied by the user.\n\nI see why this isn\u0027t the storage layer\u0027s job. It\u0027s up to input validation at the transport layer to handle this case.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"},{"author":{"_account_id":6943,"name":"Zhihao Yuan","email":"zhihao.yuan@rackspace.com","username":"zyuan"},"change_message_id":"f8e7fa028739345d6e43b9394db46948e78d15e5","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        ttl_delta \u003d datetime.timedelta(seconds\u003dttl)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        expires \u003d now + ttl_delta"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"        msg_ctrl \u003d self.driver.message_controller"},{"line_number":200,"context_line":"        claimed \u003d msg_ctrl.claimed(queue, cid, expires\u003dnow,"},{"line_number":201,"context_line":"                                   limit\u003d1, project\u003dproject)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4bc%3D","line":198,"in_reply_to":"AAAARH%2F%2F4dQ%3D","updated":"2013-08-15 19:38:50.000000000","message":"No need to mention, it\u0027s not storage\u0027s job.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"}],"marconi/storage/mongodb/messages.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"bbccc1fa734397581463777d712e387cea9fb8d4","unresolved":false,"context_lines":[{"line_number":272,"context_line":"            \u0027e\u0027: {\u0027$gt\u0027: now},"},{"line_number":273,"context_line":"        }"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        if not echo:"},{"line_number":276,"context_line":"            query[\u0027u\u0027] \u003d {\u0027$ne\u0027: client_uuid}"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        if marker:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4c8%3D","line":275,"updated":"2013-08-15 19:30:43.000000000","message":"Same here: # NOTE.\n\nIt\u0027s a little more obvious since we require client_uuid at the transport level now. I like the idea of standardization on dict to capture interesting fields.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"}],"marconi/storage/mongodb/queues.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"bbccc1fa734397581463777d712e387cea9fb8d4","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            now \u003d timeutils.utcnow()"},{"line_number":168,"context_line":"            message_stats[\u0027oldest\u0027] \u003d utils.stat_message(oldest, now)"},{"line_number":169,"context_line":"            message_stats[\u0027newest\u0027] \u003d utils.stat_message(newest, now)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        return {\u0027messages\u0027: message_stats}"},{"line_number":172,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4c0%3D","line":169,"updated":"2013-08-15 19:30:43.000000000","message":"Could you replace the total !\u003d 0 that you removed with a \u0027if total \u003d\u003d 0: pass\u0027? This let\u0027s us avoid DB queries when we don\u0027t need to and still keeps our code clean.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"},{"author":{"_account_id":6943,"name":"Zhihao Yuan","email":"zhihao.yuan@rackspace.com","username":"zyuan"},"change_message_id":"c4efd333ce2bc51b89804e4004f0584b636b9b70","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            now \u003d timeutils.utcnow()"},{"line_number":168,"context_line":"            message_stats[\u0027oldest\u0027] \u003d utils.stat_message(oldest, now)"},{"line_number":169,"context_line":"            message_stats[\u0027newest\u0027] \u003d utils.stat_message(newest, now)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        return {\u0027messages\u0027: message_stats}"},{"line_number":172,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F1kM%3D","line":169,"in_reply_to":"AAAARH%2F%2F4Vg%3D","updated":"2013-08-16 14:15:44.000000000","message":"Two checkings can\u0027t have consistency.  I leave the one which is safe there.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"},{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"e1dbfe5ca63feaa34d59551f7c7d2c2172fb86db","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            now \u003d timeutils.utcnow()"},{"line_number":168,"context_line":"            message_stats[\u0027oldest\u0027] \u003d utils.stat_message(oldest, now)"},{"line_number":169,"context_line":"            message_stats[\u0027newest\u0027] \u003d utils.stat_message(newest, now)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        return {\u0027messages\u0027: message_stats}"},{"line_number":172,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4Vg%3D","line":169,"in_reply_to":"AAAARH%2F%2F4bA%3D","updated":"2013-08-15 20:05:41.000000000","message":"Good point.\n\nThis brings up another problem. Sometimes, users will get inconsistent stats in the face of a race condition. For example, given that total becomes \u003e 0 between message_stats \u003d {} and oldest \u003d controller.first(...), then the return result will have total \u003d\u003d 0, claimed \u003d\u003d 0, and free \u003d\u003d 0, yet still be able to list the oldest and newest messages.\n\nThoughts? It seems to me like the if check prevents that inconsistency in the presence of a race condition.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"},{"author":{"_account_id":6943,"name":"Zhihao Yuan","email":"zhihao.yuan@rackspace.com","username":"zyuan"},"change_message_id":"f8e7fa028739345d6e43b9394db46948e78d15e5","unresolved":false,"context_lines":[{"line_number":166,"context_line":"        else:"},{"line_number":167,"context_line":"            now \u003d timeutils.utcnow()"},{"line_number":168,"context_line":"            message_stats[\u0027oldest\u0027] \u003d utils.stat_message(oldest, now)"},{"line_number":169,"context_line":"            message_stats[\u0027newest\u0027] \u003d utils.stat_message(newest, now)"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        return {\u0027messages\u0027: message_stats}"},{"line_number":172,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4bA%3D","line":169,"in_reply_to":"AAAARH%2F%2F4c0%3D","updated":"2013-08-15 19:38:50.000000000","message":"The `if` test is pretty much useless, because there is an window between two queries.  So first it\u0027s wrong, and second it does not help performance because seldom people stats on empty queues.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"}],"marconi/storage/sqlite/queues.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"bbccc1fa734397581463777d712e387cea9fb8d4","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                pass"},{"line_number":164,"context_line":"            else:"},{"line_number":165,"context_line":"                message_stats[\u0027oldest\u0027] \u003d utils.stat_message(oldest)"},{"line_number":166,"context_line":"                message_stats[\u0027newest\u0027] \u003d utils.stat_message(newest)"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"            return {\u0027messages\u0027: message_stats}"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAARH%2F%2F4cw%3D","line":166,"updated":"2013-08-15 19:30:43.000000000","message":"Same as earlier.","commit_id":"077fab4fde688618dae7e9adb778660dbafd3d45"}]}
