)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"48e93a824cfc8decdf7f59303b74f075f809c8b7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"8ab44cf4_cbe2859a","updated":"2021-12-09 14:40:38.000000000","message":"great additions; I\u0027ll squash it down - but I\u0027d like to talk/think more about the KeyError","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"}],"swift/obj/updater.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6079d3f05cf89d807f67f69eec89ac5af934b94f","unresolved":true,"context_lines":[{"line_number":78,"context_line":"            try:"},{"line_number":79,"context_line":"                bucket_key \u003d self._bucket_key(update_ctx[\u0027update\u0027])"},{"line_number":80,"context_line":"            except KeyError:"},{"line_number":81,"context_line":"                # this is unexpected, but defensive"},{"line_number":82,"context_line":"                return update_ctx"},{"line_number":83,"context_line":"            now \u003d time.time()"},{"line_number":84,"context_line":"            if self.next_update[bucket_key] \u003e now:"}],"source_content_type":"text/x-python","patch_set":1,"id":"117eb56f_f8ae0f21","line":81,"updated":"2021-12-09 14:25:44.000000000","message":"I was tempted to remove the try/except altogether but wondered if this might future proof in some way, if keys were ever removed from the update data?","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"48e93a824cfc8decdf7f59303b74f075f809c8b7","unresolved":true,"context_lines":[{"line_number":78,"context_line":"            try:"},{"line_number":79,"context_line":"                bucket_key \u003d self._bucket_key(update_ctx[\u0027update\u0027])"},{"line_number":80,"context_line":"            except KeyError:"},{"line_number":81,"context_line":"                # this is unexpected, but defensive"},{"line_number":82,"context_line":"                return update_ctx"},{"line_number":83,"context_line":"            now \u003d time.time()"},{"line_number":84,"context_line":"            if self.next_update[bucket_key] \u003e now:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fb023de4_7279d8e9","line":81,"updated":"2021-12-09 14:40:38.000000000","message":"tests seem happy now; I have some code that looks at all our asyncs in the cluster doing:\n\n    container_path \u003d update_data.get(\u0027container_path\u0027)\n    if container_path:\n        account, container \u003d split_path(\u0027/\u0027 + container_path, minsegs\u003d2)\n    else:\n        account, container \u003d \\\n            update_data[\u0027account\u0027], update_data[\u0027container\u0027]\n\nso i\u0027d guess we won\u0027t KeyError - I wonder if this \u0027container_path\u0027 is more accurate some how (when sharding?)","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"f78720a1f16972abaf513d6caa064ad7b52bd214","unresolved":true,"context_lines":[{"line_number":78,"context_line":"            try:"},{"line_number":79,"context_line":"                bucket_key \u003d self._bucket_key(update_ctx[\u0027update\u0027])"},{"line_number":80,"context_line":"            except KeyError:"},{"line_number":81,"context_line":"                # this is unexpected, but defensive"},{"line_number":82,"context_line":"                return update_ctx"},{"line_number":83,"context_line":"            now \u003d time.time()"},{"line_number":84,"context_line":"            if self.next_update[bucket_key] \u003e now:"}],"source_content_type":"text/x-python","patch_set":1,"id":"075e06d0_b15f0918","line":81,"in_reply_to":"fb023de4_7279d8e9","updated":"2021-12-09 15:15:56.000000000","message":"interesting\n\nalso wonder if it would be nicer to have _bucket_key deal with any exceptions and return None if it cannot produce a key?","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"}],"test/unit/obj/test_updater.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"48e93a824cfc8decdf7f59303b74f075f809c8b7","unresolved":true,"context_lines":[{"line_number":40,"context_line":"from swift.common.header_key_dict import HeaderKeyDict"},{"line_number":41,"context_line":"from swift.common.swob import bytes_to_wsgi"},{"line_number":42,"context_line":"from swift.common.utils import ("},{"line_number":43,"context_line":"    hash_path, normalize_timestamp, mkdirs, write_pickle)"},{"line_number":44,"context_line":"from swift.common.storage_policy import StoragePolicy, POLICIES"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ca88d72a_d0078d20","line":43,"updated":"2021-12-09 14:40:38.000000000","message":"looks like write_pickle isn\u0027t used anymore","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"48e93a824cfc8decdf7f59303b74f075f809c8b7","unresolved":true,"context_lines":[{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        def mock_time_function():"},{"line_number":306,"context_line":"            rv \u003d now[0]"},{"line_number":307,"context_line":"            now[0] +\u003d 4"},{"line_number":308,"context_line":"            return rv"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        # With 10s between updates, time() advancing 4s every time we look,"}],"source_content_type":"text/x-python","patch_set":1,"id":"36faecc1_6e90b76a","line":307,"updated":"2021-12-09 14:40:38.000000000","message":"with a incr of 2 I get:\n\nAssertionError: 4 !\u003d 3 at line 320\n\nwith an incr of 5 I get:\n\nAssertionError: 4 !\u003d 7\n\nWith 3 or 4 this test seems to reliably pass; in the parent patch passing values seem to be: 5-9\n\nit seems like the only thing that changed is we don\u0027t hit the KeyError... so maybe, more calls to time.time","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"f78720a1f16972abaf513d6caa064ad7b52bd214","unresolved":true,"context_lines":[{"line_number":304,"context_line":""},{"line_number":305,"context_line":"        def mock_time_function():"},{"line_number":306,"context_line":"            rv \u003d now[0]"},{"line_number":307,"context_line":"            now[0] +\u003d 4"},{"line_number":308,"context_line":"            return rv"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        # With 10s between updates, time() advancing 4s every time we look,"}],"source_content_type":"text/x-python","patch_set":1,"id":"15b1cc62_8f1e12e7","line":307,"in_reply_to":"36faecc1_6e90b76a","updated":"2021-12-09 15:15:56.000000000","message":"yes, the change is because we now actually exercise the rate limiter\n\nthese tests that try to play out time are very brittle - another way to workaround is to add a get_elapsed_time() helper in the updater and mock that, so only those times are faked ??","commit_id":"ebe570d1a434f98d8a70a025ab5aaa2ca7c5f819"}]}
