)]}'
{"swift/common/utils.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"99921d8972598bc422a952f431a7f9093abf8716","unresolved":false,"context_lines":[{"line_number":2943,"context_line":"    try:"},{"line_number":2944,"context_line":"        os.rmdir(path)"},{"line_number":2945,"context_line":"    except OSError:"},{"line_number":2946,"context_line":"        pass"},{"line_number":2947,"context_line":""},{"line_number":2948,"context_line":""},{"line_number":2949,"context_line":"def audit_location_generator(devices, datadir, suffix\u003d\u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_55ca5419","line":2946,"updated":"2018-10-17 21:02:22.000000000","message":"I wonder if this should (optionally?) only ignore ENOENT and ENOTEMPTY...","commit_id":"769ed85e1db94291fccabc05c703ee532e2d0303"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"e8b3bb914c080f22b92e4466d544e03a60a1fe30","unresolved":false,"context_lines":[{"line_number":2943,"context_line":"    try:"},{"line_number":2944,"context_line":"        os.rmdir(path)"},{"line_number":2945,"context_line":"    except OSError:"},{"line_number":2946,"context_line":"        pass"},{"line_number":2947,"context_line":""},{"line_number":2948,"context_line":""},{"line_number":2949,"context_line":"def audit_location_generator(devices, datadir, suffix\u003d\u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_246753bb","line":2946,"in_reply_to":"3f79a3b5_55ca5419","updated":"2018-10-18 20:07:32.000000000","message":"Yes maybe it\u0027s a good idea to raise (or just log?) in other cases so that problems may get fixed. I\u0027ll add this.","commit_id":"769ed85e1db94291fccabc05c703ee532e2d0303"}],"swift/obj/reconstructor.py":[{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"2817ad6440b5f4abcd994fdd754f3bd37dea3056","unresolved":false,"context_lines":[{"line_number":745,"context_line":"        previous_suffix \u003d current_suffix \u003d None"},{"line_number":746,"context_line":"        for object_hash, timestamps in sorted(objects.items(),"},{"line_number":747,"context_line":"                                              key\u003dlambda (k, v): object_suffix("},{"line_number":748,"context_line":"                                                      k)):"},{"line_number":749,"context_line":"            try:"},{"line_number":750,"context_line":"                df \u003d df_mgr.get_diskfile_from_hash("},{"line_number":751,"context_line":"                    job[\u0027local_dev\u0027][\u0027device\u0027], job[\u0027partition\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d4e67114","line":748,"updated":"2018-10-17 14:15:15.000000000","message":"I could also get an ordered dict from the caller so this would not be necessary.\nOr, try to remove the suffix for each object (the replicator does this)","commit_id":"769ed85e1db94291fccabc05c703ee532e2d0303"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"e8b3bb914c080f22b92e4466d544e03a60a1fe30","unresolved":false,"context_lines":[{"line_number":745,"context_line":"        previous_suffix \u003d current_suffix \u003d None"},{"line_number":746,"context_line":"        for object_hash, timestamps in sorted(objects.items(),"},{"line_number":747,"context_line":"                                              key\u003dlambda (k, v): object_suffix("},{"line_number":748,"context_line":"                                                      k)):"},{"line_number":749,"context_line":"            try:"},{"line_number":750,"context_line":"                df \u003d df_mgr.get_diskfile_from_hash("},{"line_number":751,"context_line":"                    job[\u0027local_dev\u0027][\u0027device\u0027], job[\u0027partition\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_24c3d35a","line":748,"in_reply_to":"3f79a3b5_b54ac87f","updated":"2018-10-18 20:07:32.000000000","message":"We discussed this with Romain, it\u0027s difficult to bench (extra IO if we batch rmdir\u0027s at the end may happen if there is a lot of memory pressure, and/or the revert job takes a long time? Benching it on a HDD, it made no  discernable difference, but that machine was otherwise mostly idle). \n\nI otherwise checked that these rmdir\u0027s, whether batched or not, cost us very little, on the first run from a \"cold\" cache, and save about 12% of time over two runs.","commit_id":"769ed85e1db94291fccabc05c703ee532e2d0303"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"99921d8972598bc422a952f431a7f9093abf8716","unresolved":false,"context_lines":[{"line_number":745,"context_line":"        previous_suffix \u003d current_suffix \u003d None"},{"line_number":746,"context_line":"        for object_hash, timestamps in sorted(objects.items(),"},{"line_number":747,"context_line":"                                              key\u003dlambda (k, v): object_suffix("},{"line_number":748,"context_line":"                                                      k)):"},{"line_number":749,"context_line":"            try:"},{"line_number":750,"context_line":"                df \u003d df_mgr.get_diskfile_from_hash("},{"line_number":751,"context_line":"                    job[\u0027local_dev\u0027][\u0027device\u0027], job[\u0027partition\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_b54ac87f","line":748,"in_reply_to":"3f79a3b5_d4e67114","updated":"2018-10-17 21:02:22.000000000","message":"Or, build a set of directories to try to remove and do them at the end:\n\n directories_to_delete \u003d set()\n \n for object_hash, timestamps in objects.items():\n     try:\n         ...\n     directories_to_delete.add(os.path.join(job[\u0027path\u0027], previous_suffix))\n \n for directory in directories_to_delete:\n     remove_directory(directory)\n\n*shrug*\n\nThere\u0027s something to be said for doing it as we go, though...","commit_id":"769ed85e1db94291fccabc05c703ee532e2d0303"}]}
