)]}'
{"swift/cli/relinker.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"11b05c110ba5a763e4b24505ea70316b1b347e2e","unresolved":true,"context_lines":[{"line_number":171,"context_line":"        for new_part in (2 * partition, 2 * partition + 1):"},{"line_number":172,"context_line":"            diskfile_manager.get_hashes(device, new_part, [], policy)"},{"line_number":173,"context_line":"    elif step \u003d\u003d STEP_CLEANUP:"},{"line_number":174,"context_line":"        hashes \u003d diskfile_manager.get_hashes(device, partition, [], policy)"},{"line_number":175,"context_line":"        # In any reasonably-large cluster, we\u0027d expect all old partitions P"},{"line_number":176,"context_line":"        # to be empty after cleanup (i.e., it\u0027s unlikely that there\u0027s another"},{"line_number":177,"context_line":"        # partition Q :\u003d P//2 that also has data on this device)."}],"source_content_type":"text/x-python","patch_set":1,"id":"010382cb_9c18555a","side":"PARENT","line":174,"updated":"2021-03-22 15:36:37.000000000","message":"oic, it\u0027s hard to imagine this running w/o all three files existing","commit_id":"c6a64036651e18f3d7d0715c5d4876257aaa0e6f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cfdd1e08fe591516313a04fba0ca13c4586f698b","unresolved":true,"context_lines":[{"line_number":185,"context_line":"                # Same lock used by invalidate_hashes, consolidate_hashes,"},{"line_number":186,"context_line":"                # get_hashes"},{"line_number":187,"context_line":"                try:"},{"line_number":188,"context_line":"                    os.unlink(os.path.join(partition_path, \u0027hashes.pkl\u0027))"},{"line_number":189,"context_line":"                    os.unlink(os.path.join(partition_path, \u0027hashes.invalid\u0027))"},{"line_number":190,"context_line":"                    os.unlink(os.path.join(partition_path, \u0027.lock\u0027))"},{"line_number":191,"context_line":"                except OSError:"},{"line_number":192,"context_line":"                    pass"},{"line_number":193,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"8d525fac_6caa72e8","side":"PARENT","line":190,"range":{"start_line":188,"start_character":20,"end_line":190,"end_character":68},"updated":"2021-03-19 17:43:35.000000000","message":"LOL. Now I don\u0027t feel quite so bad about https://review.opendev.org/c/openstack/swift/+/779813/7/test/unit/common/test_utils.py#3021","commit_id":"c6a64036651e18f3d7d0715c5d4876257aaa0e6f"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"cfdd1e08fe591516313a04fba0ca13c4586f698b","unresolved":true,"context_lines":[{"line_number":190,"context_line":"                            os.unlink(os.path.join(partition_path, f))"},{"line_number":191,"context_line":"                        except OSError as e:"},{"line_number":192,"context_line":"                            if e.errno !\u003d errno.ENOENT:"},{"line_number":193,"context_line":"                                raise"},{"line_number":194,"context_line":"                except OSError:"},{"line_number":195,"context_line":"                    pass"},{"line_number":196,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"b6998a10_f5754b11","line":193,"updated":"2021-03-19 17:43:35.000000000","message":"+1","commit_id":"a97b48d9d148bb48469c17d79b4ce45b3c9262da"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"590fa7d6dd06bdee37f30922a9609f3afb63c3b4","unresolved":true,"context_lines":[{"line_number":222,"context_line":"                                if e.errno !\u003d errno.ENOENT:"},{"line_number":223,"context_line":"                                    raise"},{"line_number":224,"context_line":"                    except OSError:"},{"line_number":225,"context_line":"                        pass"},{"line_number":226,"context_line":"                try:"},{"line_number":227,"context_line":"                    os.rmdir(partition_path)"},{"line_number":228,"context_line":"                except OSError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"e3c2114a_0b2529a9","line":225,"updated":"2021-03-29 15:35:53.000000000","message":"meh \n\n    diff --git a/swift/cli/relinker.py b/swift/cli/relinker.py\n    index f582d4352..c5c7d73ef 100644\n    --- a/swift/cli/relinker.py\n    +++ b/swift/cli/relinker.py\n    @@ -214,15 +214,12 @@ class Relinker(object):\n                     with lock_path(partition_path):\n                         # Same lock used by invalidate_hashes, consolidate_hashes,\n                         # get_hashes\n    -                    try:\n    -                        for f in (\u0027hashes.pkl\u0027, \u0027hashes.invalid\u0027, \u0027.lock\u0027):\n    -                            try:\n    -                                os.unlink(os.path.join(partition_path, f))\n    -                            except OSError as e:\n    -                                if e.errno !\u003d errno.ENOENT:\n    -                                    raise\n    -                    except OSError:\n    -                        pass\n    +                    for f in (\u0027hashes.pkl\u0027, \u0027hashes.invalid\u0027, \u0027.lock\u0027):\n    +                        try:\n    +                            os.unlink(os.path.join(partition_path, f))\n    +                        except OSError:\n    +                            # expect ENOENT, try to rmdir regardless\n    +                            pass\n                     try:\n                         os.rmdir(partition_path)\n                     except OSError:","commit_id":"4ef7b10e0f6e9753a7d65de15ca156f7ea6f036d"}],"test/unit/cli/test_relinker.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"590fa7d6dd06bdee37f30922a9609f3afb63c3b4","unresolved":true,"context_lines":[{"line_number":1640,"context_line":"            ]))"},{"line_number":1641,"context_line":"        self.assertEqual([True], calls)"},{"line_number":1642,"context_line":"        # old partition can still be cleaned up"},{"line_number":1643,"context_line":"        self.assertFalse(os.path.exists(self.part_dir))"},{"line_number":1644,"context_line":""},{"line_number":1645,"context_line":"    def test_cleanup_reapable(self):"},{"line_number":1646,"context_line":"        # relink a tombstone"}],"source_content_type":"text/x-python","patch_set":2,"id":"510f5de0_7aa77f8d","line":1643,"updated":"2021-03-29 15:35:53.000000000","message":"LGTM:\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nFAIL: test_cleanup_old_part_robust (test.unit.cli.test_relinker.TestRelinker)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n  File \"/home/vagrant/swift/test/unit/cli/test_relinker.py\", line 1643, in test_cleanup_old_part_robust\n    self.assertFalse(os.path.exists(self.part_dir))\nAssertionError: True is not false\n-------------------- \u003e\u003e begin captured logging \u003c\u003c --------------------\nroot: INFO: Processing files for policy platinum under /mnt/tmp/tmpIU79Qc/node (cleanup\u003dTrue)\nroot: DEBUG: Run listdir on /mnt/tmp/tmpIU79Qc/node/sda1/objects/103\nroot: INFO: Device: sda1 Step: cleanup Partitions: 1/2\nroot: DEBUG: Removed /mnt/tmp/tmpIU79Qc/node/sda1/objects/51/ce9/33ddc9d8fa8800d70356a66fd9937ce9/1617031891.19158.data\nroot: DEBUG: Run listdir on /mnt/tmp/tmpIU79Qc/node/sda1/objects/51\nroot: INFO: Device: sda1 Step: cleanup Partitions: 2/2\nroot: INFO: 1 hash dirs processed (cleanup\u003dTrue) (1 files, 0 linked, 1 removed, 0 errors)\n--------------------- \u003e\u003e end captured logging \u003c\u003c ---------------------\n\n----------------------------------------------------------------------\nRan 59 tests in 4.476s\n\nFAILED (failures\u003d1)","commit_id":"4ef7b10e0f6e9753a7d65de15ca156f7ea6f036d"}]}
