)]}'
{"swift/container/sync.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"042b07a7f038295c344f327b5b48e29a30dad3c0","unresolved":false,"context_lines":[{"line_number":575,"context_line":"                        self.swift.get_object(info[\u0027account\u0027],"},{"line_number":576,"context_line":"                                              info[\u0027container\u0027], row[\u0027name\u0027],"},{"line_number":577,"context_line":"                                              headers\u003dheaders_out,"},{"line_number":578,"context_line":"                                              acceptable_statuses\u003d(2, 4))"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"                except (Exception, UnexpectedResponse, Timeout) as err:"},{"line_number":581,"context_line":"                    headers \u003d {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf8cb3f7_49859559","line":578,"range":{"start_line":578,"start_character":70,"end_line":578,"end_character":71},"updated":"2017-12-27 22:43:08.000000000","message":"Why on earth is this all of 4xx?? Surely the only reasonable response codes are 200 or 404, yeah?","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"adfd050406ad32d3399497f186582f90620ec4c2","unresolved":false,"context_lines":[{"line_number":581,"context_line":"                    headers \u003d {}"},{"line_number":582,"context_line":"                    body \u003d None"},{"line_number":583,"context_line":"                    if ts_meta \u003e 0:"},{"line_number":584,"context_line":"                        raise"},{"line_number":585,"context_line":"                timestamp \u003d Timestamp(headers.get(\u0027x-timestamp\u0027, 0))"},{"line_number":586,"context_line":"                if timestamp \u003c ts_meta:"},{"line_number":587,"context_line":"                    raise Exception("}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_5b9fde02","line":584,"updated":"2017-08-24 18:47:12.000000000","message":"I don\u0027t see how this is equivalent to existing code?  I tried forcing this boolean one way or another and adding some NameErrors in this block - but I don\u0027t think this code is tested? (!)","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c18f4e2681545f912b96cf2566471f298b586377","unresolved":false,"context_lines":[{"line_number":581,"context_line":"                    headers \u003d {}"},{"line_number":582,"context_line":"                    body \u003d None"},{"line_number":583,"context_line":"                    if ts_meta \u003e 0:"},{"line_number":584,"context_line":"                        raise"},{"line_number":585,"context_line":"                timestamp \u003d Timestamp(headers.get(\u0027x-timestamp\u0027, 0))"},{"line_number":586,"context_line":"                if timestamp \u003c ts_meta:"},{"line_number":587,"context_line":"                    raise Exception("}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_deacdc8d","line":584,"in_reply_to":"7f287b81_5b9fde02","updated":"2017-08-24 19:13:21.000000000","message":"Old code had us raise if we caught an exception and timestamp \u003c ts_meta yeah? But timestamp came from headers, and when we caught an exception, we explicitly say headers \u003d {}. So exc is not None implies timestamp \u003d 0. So we may as well just check for whether ts_meta \u003e 0. QED.\n\nAs for why we re-raise instead of capturing the exception and raising it later -- old code results in stack traces that end in this function, at the\n\n raise exc\n\nline. Now, we\u0027ll get stack traces down into get_object that can actually show us *what went wrong*.","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"042b07a7f038295c344f327b5b48e29a30dad3c0","unresolved":false,"context_lines":[{"line_number":584,"context_line":"                        raise"},{"line_number":585,"context_line":"                timestamp \u003d Timestamp(headers.get(\u0027x-timestamp\u0027, 0))"},{"line_number":586,"context_line":"                if timestamp \u003c ts_meta:"},{"line_number":587,"context_line":"                    raise Exception("},{"line_number":588,"context_line":"                        _(\u0027Unknown exception trying to GET: \u0027"},{"line_number":589,"context_line":"                          \u0027%(account)r %(container)r %(object)r\u0027),"},{"line_number":590,"context_line":"                        {\u0027account\u0027: info[\u0027account\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf8cb3f7_e9aa69d0","line":587,"updated":"2017-12-27 22:43:08.000000000","message":"\"Unknown exception\" my foot! We got a response that was either 2xx or 4xx, but the timestamp associated with it was before the last update we wrote down. Wherever that update came from (most likely a handoff), it doesn\u0027t seem to be available right now, so let\u0027s just wait a bit and let the replicators get things where they need to go.","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"042b07a7f038295c344f327b5b48e29a30dad3c0","unresolved":false,"context_lines":[{"line_number":600,"context_line":"                        headers[\u0027content-type\u0027])"},{"line_number":601,"context_line":"                self._update_sync_to_headers(row[\u0027name\u0027], sync_to, user_key,"},{"line_number":602,"context_line":"                                             realm, realm_key, \u0027PUT\u0027, headers)"},{"line_number":603,"context_line":"                put_object(sync_to, name\u003drow[\u0027name\u0027], headers\u003dheaders,"},{"line_number":604,"context_line":"                           contents\u003dFileLikeIter(body),"},{"line_number":605,"context_line":"                           proxy\u003dself.select_http_proxy(), logger\u003dself.logger,"},{"line_number":606,"context_line":"                           timeout\u003dself.conn_timeout)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf8cb3f7_09f46df1","line":603,"updated":"2017-12-27 22:43:08.000000000","message":"Am I reading this right? If a container server is out of date and missed a delete... then when the container-sync daemon is processing rows and gets back a 404 with a newer timestamp... it writes a zero-byte object? Why not issue a DELETE?","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"}],"test/unit/container/test_sync.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"adfd050406ad32d3399497f186582f90620ec4c2","unresolved":false,"context_lines":[{"line_number":1108,"context_line":"            excepted_failure_count +\u003d 1"},{"line_number":1109,"context_line":"            self.assertEqual(["},{"line_number":1110,"context_line":"                {key: value for key, value in headers.items() if key in ("},{"line_number":1111,"context_line":"                    \u0027X-Newest\u0027, \u0027X-Backend-Storage-Policy-Index\u0027)}"},{"line_number":1112,"context_line":"                for headers in captured_headers"},{"line_number":1113,"context_line":"            ], [{\u0027X-Newest\u0027: True, \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027}])"},{"line_number":1114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_fbc68a49","line":1111,"updated":"2017-08-24 18:47:12.000000000","message":"I don\u0027t think the filter is a good trade off readability/maintainability.  This works for me and seems easier to grok and/or modify as needed:\n\n    diff --git a/test/unit/container/test_sync.py b/test/unit/container/test_sync.py\n    index 849a98c..dbacb0a 100644\n    --- a/test/unit/container/test_sync.py\n    +++ b/test/unit/container/test_sync.py\n    @@ -1106,11 +1106,10 @@ class TestContainerSync(unittest.TestCase):\n                     realm, realm_key))\n                 self.assertEqual(cs.container_puts, expected_put_count)\n                 excepted_failure_count +\u003d 1\n    -            self.assertEqual([\n    -                {key: value for key, value in headers.items() if key in (\n    -                    \u0027X-Newest\u0027, \u0027X-Backend-Storage-Policy-Index\u0027)}\n    -                for headers in captured_headers\n    -            ], [{\u0027X-Newest\u0027: True, \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027}])\n    +            self.assertEqual([{\n    +                \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027,\n    +                \u0027X-Newest\u0027: True,\n    +            }], captured_headers)\n     \n                 captured_headers \u003d []\n     \n    @@ -1130,11 +1129,10 @@ class TestContainerSync(unittest.TestCase):\n                     realm, realm_key))\n                 self.assertEqual(cs.container_puts, expected_put_count)\n                 excepted_failure_count +\u003d 1\n    -            self.assertEqual([\n    -                {key: value for key, value in headers.items() if key in (\n    -                    \u0027X-Newest\u0027, \u0027X-Backend-Storage-Policy-Index\u0027)}\n    -                for headers in captured_headers\n    -            ], [{\u0027X-Newest\u0027: True, \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027}])\n    +            self.assertEqual([{\n    +                \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027,\n    +                \u0027X-Newest\u0027: True,\n    +            }], captured_headers)\n     \n                 captured_get_headers \u003d []\n     \n    @@ -1161,11 +1159,10 @@ class TestContainerSync(unittest.TestCase):\n                     realm, realm_key))\n                 self.assertEqual(cs.container_puts, expected_put_count)\n                 excepted_failure_count +\u003d 1\n    -            self.assertEqual([\n    -                {key: value for key, value in headers.items() if key in (\n    -                    \u0027X-Newest\u0027, \u0027X-Backend-Storage-Policy-Index\u0027)}\n    -                for headers in captured_get_headers\n    -            ], [{\u0027X-Newest\u0027: True, \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027}])\n    +            self.assertEqual([{\n    +                \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027,\n    +                \u0027X-Newest\u0027: True,\n    +            }], captured_headers)\n                 self.assertEqual(cs.container_failures, excepted_failure_count)\n                 self.assertLogMessage(\u0027info\u0027, \u0027Unauth\u0027)","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c18f4e2681545f912b96cf2566471f298b586377","unresolved":false,"context_lines":[{"line_number":1108,"context_line":"            excepted_failure_count +\u003d 1"},{"line_number":1109,"context_line":"            self.assertEqual(["},{"line_number":1110,"context_line":"                {key: value for key, value in headers.items() if key in ("},{"line_number":1111,"context_line":"                    \u0027X-Newest\u0027, \u0027X-Backend-Storage-Policy-Index\u0027)}"},{"line_number":1112,"context_line":"                for headers in captured_headers"},{"line_number":1113,"context_line":"            ], [{\u0027X-Newest\u0027: True, \u0027X-Backend-Storage-Policy-Index\u0027: \u00270\u0027}])"},{"line_number":1114,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_1edb84ed","line":1111,"in_reply_to":"7f287b81_fbc68a49","updated":"2017-08-24 19:13:21.000000000","message":"Sure, if that works, great. I was just staying true to the assertions that were previously being made -- I\u0027m fine with tightening them. Honestly, I hadn\u0027t looked into it too deeply; this was yet another thing that shook out of https://review.openstack.org/#/c/496535/ and I just wanted a fairly direct translation that would actually work properly.","commit_id":"f05d287c8db013dd5dc99e963f437dfea508d9c5"}]}
