)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e6c21137cc53881f8d07042208541f925f14b255","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        import_method \u003d body.get(\u0027method\u0027).get(\u0027name\u0027)"},{"line_number":217,"context_line":"        uri \u003d body.get(\u0027method\u0027).get(\u0027uri\u0027)"},{"line_number":218,"context_line":"        all_stores_must_succeed \u003d body.get(\u0027all_stores_must_succeed\u0027, True)"},{"line_number":219,"context_line":"        stole_lock_from_task \u003d None"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        try:"},{"line_number":222,"context_line":"            image \u003d image_repo.get(image_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_5e777c3b","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":28},"updated":"2020-08-17 16:15:47.000000000","message":"can we name it to stale_task? as it will be task object.","commit_id":"66c612026cc6e1d5d010b8b2f9b1e46bb3b56189"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd377d27f853228cb1e4e84186eee1609d4afbe4","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        import_method \u003d body.get(\u0027method\u0027).get(\u0027name\u0027)"},{"line_number":217,"context_line":"        uri \u003d body.get(\u0027method\u0027).get(\u0027uri\u0027)"},{"line_number":218,"context_line":"        all_stores_must_succeed \u003d body.get(\u0027all_stores_must_succeed\u0027, True)"},{"line_number":219,"context_line":"        stole_lock_from_task \u003d None"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        try:"},{"line_number":222,"context_line":"            image \u003d image_repo.get(image_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_a104bdc7","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":28},"in_reply_to":"9f560f44_5e777c3b","updated":"2020-08-17 16:56:41.000000000","message":"Note that this is \"stole\" not \"stale\", but sure, stale_task is fine too if you prefer. I like this sort of naming because \"if stole_lock_from_task\" reads well below on L348 and makes it more intuitive, IMHO, but it\u0027s not a big deal.","commit_id":"66c612026cc6e1d5d010b8b2f9b1e46bb3b56189"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b649b6bcef6e36bd872fa30a91bce560871d8bd9","unresolved":false,"context_lines":[{"line_number":216,"context_line":"        import_method \u003d body.get(\u0027method\u0027).get(\u0027name\u0027)"},{"line_number":217,"context_line":"        uri \u003d body.get(\u0027method\u0027).get(\u0027uri\u0027)"},{"line_number":218,"context_line":"        all_stores_must_succeed \u003d body.get(\u0027all_stores_must_succeed\u0027, True)"},{"line_number":219,"context_line":"        stole_lock_from_task \u003d None"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"        try:"},{"line_number":222,"context_line":"            image \u003d image_repo.get(image_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_a1bb1de3","line":219,"range":{"start_line":219,"start_character":8,"end_line":219,"end_character":28},"in_reply_to":"9f560f44_a104bdc7","updated":"2020-08-17 17:03:07.000000000","message":"then may be, task_stolen_from_lock \nOr let\u0027s see what other thinks.","commit_id":"66c612026cc6e1d5d010b8b2f9b1e46bb3b56189"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e6c21137cc53881f8d07042208541f925f14b255","unresolved":false,"context_lines":[{"line_number":346,"context_line":"            # to clean up the import status information left over from that"},{"line_number":347,"context_line":"            # execution."},{"line_number":348,"context_line":"            if stole_lock_from_task:"},{"line_number":349,"context_line":"                self._cleanup_states_from_task(image_repo, image,"},{"line_number":350,"context_line":"                                               stole_lock_from_task)"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"            task_repo.add(import_task)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_1ea2249b","line":349,"range":{"start_line":349,"start_character":21,"end_line":349,"end_character":46},"updated":"2020-08-17 16:15:47.000000000","message":"may be rename it to, _cleanup_previous_task_progress or _cleanup_stale_task_progress?","commit_id":"66c612026cc6e1d5d010b8b2f9b1e46bb3b56189"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"bd377d27f853228cb1e4e84186eee1609d4afbe4","unresolved":false,"context_lines":[{"line_number":346,"context_line":"            # to clean up the import status information left over from that"},{"line_number":347,"context_line":"            # execution."},{"line_number":348,"context_line":"            if stole_lock_from_task:"},{"line_number":349,"context_line":"                self._cleanup_states_from_task(image_repo, image,"},{"line_number":350,"context_line":"                                               stole_lock_from_task)"},{"line_number":351,"context_line":""},{"line_number":352,"context_line":"            task_repo.add(import_task)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_c15c51ef","line":349,"range":{"start_line":349,"start_character":21,"end_line":349,"end_character":46},"in_reply_to":"9f560f44_1ea2249b","updated":"2020-08-17 16:56:41.000000000","message":"Sure, I like the latter.","commit_id":"66c612026cc6e1d5d010b8b2f9b1e46bb3b56189"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ffc3f695228811e34594c51700bd2fbccf19d8d1","unresolved":false,"context_lines":[{"line_number":198,"context_line":"            for key in keys:"},{"line_number":199,"context_line":"                values \u003d image.extra_properties.get(key, \u0027\u0027).split(\u0027,\u0027)"},{"line_number":200,"context_line":"                if store in values:"},{"line_number":201,"context_line":"                    values.remove(store)"},{"line_number":202,"context_line":"                    changed.add(key)"},{"line_number":203,"context_line":"                image.extra_properties[key] \u003d \u0027,\u0027.join(values)"},{"line_number":204,"context_line":"        if changed:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_3f2d50fd","line":201,"updated":"2020-08-18 17:02:10.000000000","message":"I wonder if we should actually *set* the stores in failed_import if we\u0027re pre-empting that task. If it\u0027s still running and wakes up to find the lock removed, it will not be able to update this list anyway, which is good, because it would be racing with this task which is about to grab the lock.\n\nSo, we could compare image[\u0027stores\u0027] to task[\u0027input\u0027][\u0027stores\u0027] and only put failed ones in the failed list, but that could also be error-prone. I think the important thing is that they come out of the in-progress list so that it doesn\u0027t look like they\u0027re still being imported.\n\nComments here from other people which probably have strong opinions.","commit_id":"c11d275105f163b9b7359bf2fbb77ff7900c7dde"}]}
