)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"1fb8f5a3_16e7e5f4","updated":"2022-07-25 13:09:57.000000000","message":"A few comments.\n\nAlso I think we would want a bug number and a spec (https://review.opendev.org/c/openstack/glance-specs/+/787179). I\u0027m not sure this could be merged before the next cycle, and we\u0027d probably want this to be discussed at PTG.","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"706a43a5_7fe8d9c2","updated":"2022-10-18 14:41:11.000000000","message":"Most of the implementation is replicated from glance_store/_drivers/s3.py. Thus I have not changed it except one suggestion.","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"add1eb2f9f12247e3eed34bd7d487dd5765e71b1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"65b1d895_f7b3e488","updated":"2022-10-20 14:38:55.000000000","message":"recheck","commit_id":"8572c62b044851522514576093208e76e58aa110"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"eeb0e9fa4a15bcd1be2a569e0c4cdf83dd66c04b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"65888233_b12c1934","updated":"2022-11-03 08:53:39.000000000","message":"Updated as per spec at  https://review.opendev.org/c/openstack/glance-specs/+/787179.","commit_id":"e120896a8fc3199578b2b3365fb48ccd830900b0"}],"glance_store/_drivers/swift/store.py":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":true,"context_lines":[{"line_number":502,"context_line":"        self.partnum \u003d partnum"},{"line_number":503,"context_line":"        self.fp \u003d fp"},{"line_number":504,"context_line":"        self.size \u003d 0"},{"line_number":505,"context_line":"        self.chunks \u003d chunks"},{"line_number":506,"context_line":"        self.etag \u003d {}"},{"line_number":507,"context_line":"        self.success \u003d True"},{"line_number":508,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5ca513cf_cd68bcdf","line":505,"range":{"start_line":505,"start_character":27,"end_line":505,"end_character":28},"updated":"2022-07-25 13:09:57.000000000","message":"I don\u0027t understand what this attribute is. It seems used as the length of the chunk in other parts of the code (see \"len(write_chunk) at line 1123). Is it badly named or am I misunderstanding?","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[{"line_number":502,"context_line":"        self.partnum \u003d partnum"},{"line_number":503,"context_line":"        self.fp \u003d fp"},{"line_number":504,"context_line":"        self.size \u003d 0"},{"line_number":505,"context_line":"        self.chunks \u003d chunks"},{"line_number":506,"context_line":"        self.etag \u003d {}"},{"line_number":507,"context_line":"        self.success \u003d True"},{"line_number":508,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"a64b9872_03bed95e","line":505,"range":{"start_line":505,"start_character":27,"end_line":505,"end_character":28},"in_reply_to":"5ca513cf_cd68bcdf","updated":"2022-10-18 14:41:11.000000000","message":"Ack","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":true,"context_lines":[{"line_number":504,"context_line":"        self.size \u003d 0"},{"line_number":505,"context_line":"        self.chunks \u003d chunks"},{"line_number":506,"context_line":"        self.etag \u003d {}"},{"line_number":507,"context_line":"        self.success \u003d True"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def run_upload(manager, location, part):"}],"source_content_type":"text/x-python","patch_set":5,"id":"470aed4b_908cdf1d","line":507,"updated":"2022-07-25 13:09:57.000000000","message":"This class could probably be a dict/tuple/dataclass if we\u0027re not going to need any methods.","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        self.size \u003d 0"},{"line_number":505,"context_line":"        self.chunks \u003d chunks"},{"line_number":506,"context_line":"        self.etag \u003d {}"},{"line_number":507,"context_line":"        self.success \u003d True"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":""},{"line_number":510,"context_line":"def run_upload(manager, location, part):"}],"source_content_type":"text/x-python","patch_set":5,"id":"2c9689a9_de17764d","line":507,"in_reply_to":"470aed4b_908cdf1d","updated":"2022-10-18 14:41:11.000000000","message":"Ack","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":true,"context_lines":[{"line_number":526,"context_line":"    except Exception:"},{"line_number":527,"context_line":"        LOG.error(_(\"Error during chunked upload to backend, deleting stale \""},{"line_number":528,"context_line":"                    \"chunks.\"))"},{"line_number":529,"context_line":"        part.success \u003d False"},{"line_number":530,"context_line":"    finally:"},{"line_number":531,"context_line":"        part.fp.close()"},{"line_number":532,"context_line":"    msg \u003d ("}],"source_content_type":"text/x-python","patch_set":5,"id":"1d4649df_95d57485","line":529,"range":{"start_line":529,"start_character":8,"end_line":529,"end_character":20},"updated":"2022-07-25 13:09:57.000000000","message":"Wouldn\u0027t we want to raise an exception here?","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[{"line_number":526,"context_line":"    except Exception:"},{"line_number":527,"context_line":"        LOG.error(_(\"Error during chunked upload to backend, deleting stale \""},{"line_number":528,"context_line":"                    \"chunks.\"))"},{"line_number":529,"context_line":"        part.success \u003d False"},{"line_number":530,"context_line":"    finally:"},{"line_number":531,"context_line":"        part.fp.close()"},{"line_number":532,"context_line":"    msg \u003d ("}],"source_content_type":"text/x-python","patch_set":5,"id":"0c0d784a_5834513c","line":529,"range":{"start_line":529,"start_character":8,"end_line":529,"end_character":20},"in_reply_to":"1d4649df_95d57485","updated":"2022-10-18 14:41:11.000000000","message":"Ack","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":true,"context_lines":[{"line_number":528,"context_line":"                    \"chunks.\"))"},{"line_number":529,"context_line":"        part.success \u003d False"},{"line_number":530,"context_line":"    finally:"},{"line_number":531,"context_line":"        part.fp.close()"},{"line_number":532,"context_line":"    msg \u003d ("},{"line_number":533,"context_line":"        \"Wrote chunk %(chunk_name)s with id %(chunk_id)d of length \""},{"line_number":534,"context_line":"        \"%(bytes_read)d to Swift returning MD5 of content: %(chunk_etag)s\" % {"}],"source_content_type":"text/x-python","patch_set":5,"id":"79b0467a_bb2fa559","line":531,"range":{"start_line":531,"start_character":8,"end_line":531,"end_character":21},"updated":"2022-07-25 13:09:57.000000000","message":"Since the caller creates/opens part.fp, I think the caller should be closing it as well.","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[{"line_number":528,"context_line":"                    \"chunks.\"))"},{"line_number":529,"context_line":"        part.success \u003d False"},{"line_number":530,"context_line":"    finally:"},{"line_number":531,"context_line":"        part.fp.close()"},{"line_number":532,"context_line":"    msg \u003d ("},{"line_number":533,"context_line":"        \"Wrote chunk %(chunk_name)s with id %(chunk_id)d of length \""},{"line_number":534,"context_line":"        \"%(bytes_read)d to Swift returning MD5 of content: %(chunk_etag)s\" % {"}],"source_content_type":"text/x-python","patch_set":5,"id":"6d853f03_7feac4b7","line":531,"range":{"start_line":531,"start_character":8,"end_line":531,"end_character":21},"in_reply_to":"79b0467a_bb2fa559","updated":"2022-10-18 14:41:11.000000000","message":"Ack","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":true,"context_lines":[{"line_number":1039,"context_line":"                            success \u003d False"},{"line_number":1040,"context_line":"                            break"},{"line_number":1041,"context_line":""},{"line_number":1042,"context_line":"                    if not success:"},{"line_number":1043,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":1044,"context_line":"                        with excutils.save_and_reraise_exception():"},{"line_number":1045,"context_line":"                            LOG.error(_(\"Error during chunked upload \""}],"source_content_type":"text/x-python","patch_set":5,"id":"e65b92e4_cfa0525a","line":1042,"updated":"2022-07-25 13:09:57.000000000","message":"I think lines 1036 to 1042 could just be:\n\nif not all([part.success for part in plist]):","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[{"line_number":1039,"context_line":"                            success \u003d False"},{"line_number":1040,"context_line":"                            break"},{"line_number":1041,"context_line":""},{"line_number":1042,"context_line":"                    if not success:"},{"line_number":1043,"context_line":"                        # Delete orphaned segments from swift backend"},{"line_number":1044,"context_line":"                        with excutils.save_and_reraise_exception():"},{"line_number":1045,"context_line":"                            LOG.error(_(\"Error during chunked upload \""}],"source_content_type":"text/x-python","patch_set":5,"id":"47618755_6ab8e1f3","line":1042,"in_reply_to":"e65b92e4_cfa0525a","updated":"2022-10-18 14:41:11.000000000","message":"Done","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"be680f9e3554db299e8b7294b174f8e0a47f7203","unresolved":true,"context_lines":[{"line_number":1118,"context_line":"                checksum.update(write_chunk)"},{"line_number":1119,"context_line":"                if verifier:"},{"line_number":1120,"context_line":"                    verifier.update(write_chunk)"},{"line_number":1121,"context_line":"                fp \u003d io.BytesIO(write_chunk)"},{"line_number":1122,"context_line":"                fp.seek(0)"},{"line_number":1123,"context_line":"                part_size \u003d len(write_chunk)"},{"line_number":1124,"context_line":"                part \u003d UploadPart(fp, chunk_id + 1, part_size)"}],"source_content_type":"text/x-python","patch_set":5,"id":"37f2d4d3_4203f0a1","line":1121,"updated":"2022-07-25 13:09:57.000000000","message":"So here we could use a context manager:\n\nwith io.BytesIO(write_chunk) as fp:\n    ...\n    \nWhich would handle fp.close() for us.","commit_id":"f699821bc292606d1754f18b31de4d810408c831"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"0a3b6ce159d71e779ee0506556bc97f3cb9e2bc2","unresolved":false,"context_lines":[{"line_number":1118,"context_line":"                checksum.update(write_chunk)"},{"line_number":1119,"context_line":"                if verifier:"},{"line_number":1120,"context_line":"                    verifier.update(write_chunk)"},{"line_number":1121,"context_line":"                fp \u003d io.BytesIO(write_chunk)"},{"line_number":1122,"context_line":"                fp.seek(0)"},{"line_number":1123,"context_line":"                part_size \u003d len(write_chunk)"},{"line_number":1124,"context_line":"                part \u003d UploadPart(fp, chunk_id + 1, part_size)"}],"source_content_type":"text/x-python","patch_set":5,"id":"df7e4b28_8fd19774","line":1121,"in_reply_to":"37f2d4d3_4203f0a1","updated":"2022-10-18 14:41:11.000000000","message":"Ack","commit_id":"f699821bc292606d1754f18b31de4d810408c831"}]}
