)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"808c84063cd7c9583560de9f84aa4ab101bec75e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Capture the on the wire status code for logging because we change the"},{"line_number":10,"context_line":"logged status code sometimes."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Also add catch_errors to the example pipeline before proxy logging to"},{"line_number":13,"context_line":"get it\u0027s byte count enforcing exceptions."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Closes-Bug: #1896518"},{"line_number":16,"context_line":"Change-Id: I27feabe923a6520e983637a9c68a19ec7174a0df"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f560f44_8a19a07b","line":13,"range":{"start_line":12,"start_character":0,"end_line":13,"end_character":41},"updated":"2020-10-07 01:01:22.000000000","message":"Bah, forgot to clean up the commit message. This is no longer necessary.","commit_id":"3f091db825cc93399a1b0982c2d4dd47e7a7db58"}],"etc/proxy-server.conf-sample":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"395d3e109fde83de7a325a80b2ed619c1ecb5607","unresolved":false,"context_lines":[{"line_number":103,"context_line":"[pipeline:main]"},{"line_number":104,"context_line":"# This sample pipeline uses tempauth and is used for SAIO dev work and"},{"line_number":105,"context_line":"# testing. See below for a pipeline using keystone."},{"line_number":106,"context_line":"pipeline \u003d catch_errors gatekeeper healthcheck proxy-logging catch_errors cache listing_formats container_sync bulk tempurl ratelimit tempauth copy container-quotas account-quotas slo dlo versioned_writes symlink proxy-logging proxy-server"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"# The following pipeline shows keystone integration. Comment out the one"},{"line_number":109,"context_line":"# above and uncomment this one. Additional steps for integrating keystone are"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"9f560f44_224718a6","line":106,"range":{"start_line":106,"start_character":11,"end_line":106,"end_character":23},"updated":"2020-10-01 22:15:34.000000000","message":"Doubled-up?  Hm...\n\nShouldn\u0027t hurt anything, I suppose. Makes me start to wonder just how many times we\u0027re cross-checking that we sent all the bytes we promised, though...","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"}],"swift/common/middleware/proxy_logging.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"395d3e109fde83de7a325a80b2ed619c1ecb5607","unresolved":false,"context_lines":[{"line_number":356,"context_line":"        def my_start_response(status, headers, exc_info\u003dNone):"},{"line_number":357,"context_line":"            start_response_args[0] \u003d (status, list(headers), exc_info)"},{"line_number":358,"context_line":""},{"line_number":359,"context_line":"        def status_int_for_logging(client_disconnect\u003dFalse, start_status\u003dNone):"},{"line_number":360,"context_line":"            # log disconnected clients as \u0027499\u0027 status code"},{"line_number":361,"context_line":"            if client_disconnect or input_proxy.client_disconnect:"},{"line_number":362,"context_line":"                ret_status_int \u003d 499"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_c20a9c77","line":359,"range":{"start_line":359,"start_character":60,"end_line":359,"end_character":77},"updated":"2020-10-01 22:15:34.000000000","message":"I\u0027m really tempted to make this guy required.","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"395d3e109fde83de7a325a80b2ed619c1ecb5607","unresolved":false,"context_lines":[{"line_number":393,"context_line":"            method \u003d self.method_from_req(req)"},{"line_number":394,"context_line":"            ttfb \u003d 0.0"},{"line_number":395,"context_line":"            if method \u003d\u003d \u0027GET\u0027:"},{"line_number":396,"context_line":"                status_int \u003d status_int_for_logging()"},{"line_number":397,"context_line":"                policy_index \u003d get_policy_index(req.headers, resp_headers)"},{"line_number":398,"context_line":"                metric_name \u003d self.statsd_metric_name(req, status_int, method)"},{"line_number":399,"context_line":"                metric_name_policy \u003d self.statsd_metric_name_policy("}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_2219d8d0","line":396,"updated":"2020-10-01 22:15:34.000000000","message":"This has to be the same as wire_status_int, yeah?","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"395d3e109fde83de7a325a80b2ed619c1ecb5607","unresolved":false,"context_lines":[{"line_number":408,"context_line":""},{"line_number":409,"context_line":"            bytes_sent \u003d 0"},{"line_number":410,"context_line":"            client_disconnect \u003d False"},{"line_number":411,"context_line":"            start_status \u003d None"},{"line_number":412,"context_line":"            try:"},{"line_number":413,"context_line":"                while chunk:"},{"line_number":414,"context_line":"                    bytes_sent +\u003d len(chunk)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_8210a4ad","line":411,"range":{"start_line":411,"start_character":27,"end_line":411,"end_character":31},"updated":"2020-10-01 22:15:34.000000000","message":"nit: If we set this to wire_status_int straight-away, I think we can nix the whole \"if start_status is None\" bit in status_int_for_logging.","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a854350c1aa3801c18ca21ff0dc12cd0f373aa47","unresolved":false,"context_lines":[{"line_number":421,"context_line":"                raise"},{"line_number":422,"context_line":"            except Exception:"},{"line_number":423,"context_line":"                start_status \u003d 500"},{"line_number":424,"context_line":"                raise"},{"line_number":425,"context_line":"            finally:"},{"line_number":426,"context_line":"                status_int \u003d status_int_for_logging("},{"line_number":427,"context_line":"                    client_disconnect, start_status)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_e28ec078","line":424,"updated":"2020-10-02 02:28:39.000000000","message":"this plus adding a second catch_errors after proxy logging fixes https://bugs.launchpad.net/swift/+bug/1895691","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"48e82fa661b2abb3f078f3525af58f80fdd01c3b","unresolved":false,"context_lines":[{"line_number":389,"context_line":"            ttfb \u003d 0.0"},{"line_number":390,"context_line":"            if method \u003d\u003d \u0027GET\u0027:"},{"line_number":391,"context_line":"                policy_index \u003d get_policy_index(req.headers, resp_headers)"},{"line_number":392,"context_line":"                metric_name \u003d self.statsd_metric_name(req, wire_status_int, method)"},{"line_number":393,"context_line":"                metric_name_policy \u003d self.statsd_metric_name_policy("},{"line_number":394,"context_line":"                    req, wire_status_int, method, policy_index)"},{"line_number":395,"context_line":"                ttfb \u003d time.time() - start_time"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_b78eb677","line":392,"updated":"2020-10-02 21:47:01.000000000","message":"pep8: E501 line too long (83 \u003e 79 characters)","commit_id":"a12b59b85c02b3d01b50cacfc64dcd0ae196159a"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"85b0e17ea9e5eb8ace24bbc2b99c8d5b4c43329f","unresolved":false,"context_lines":[{"line_number":363,"context_line":"            return start_status"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"        def iter_response(iterable):"},{"line_number":366,"context_line":"            iterator \u003d iter(iterable)"},{"line_number":367,"context_line":"            try:"},{"line_number":368,"context_line":"                chunk \u003d next(iterator)"},{"line_number":369,"context_line":"                while not chunk:"},{"line_number":370,"context_line":"                    chunk \u003d next(iterator)"},{"line_number":371,"context_line":"            except StopIteration:"},{"line_number":372,"context_line":"                chunk \u003d b\u0027\u0027"},{"line_number":373,"context_line":"            for h, v in start_response_args[0][1]:"},{"line_number":374,"context_line":"                if h.lower() in (\u0027content-length\u0027, \u0027transfer-encoding\u0027):"},{"line_number":375,"context_line":"                    break"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_ba4cdbc9","line":372,"range":{"start_line":366,"start_character":12,"end_line":372,"end_character":27},"updated":"2020-10-03 04:31:37.000000000","message":"Off-topic: Isn\u0027t this sort of thing why we have reiterate()? https://github.com/openstack/swift/blob/2.26.0/swift/common/utils.py#L3995","commit_id":"a52aebb4c8df885206c5fa14ee0c6e36a351786c"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"85b0e17ea9e5eb8ace24bbc2b99c8d5b4c43329f","unresolved":false,"context_lines":[{"line_number":372,"context_line":"                chunk \u003d b\u0027\u0027"},{"line_number":373,"context_line":"            for h, v in start_response_args[0][1]:"},{"line_number":374,"context_line":"                if h.lower() in (\u0027content-length\u0027, \u0027transfer-encoding\u0027):"},{"line_number":375,"context_line":"                    break"},{"line_number":376,"context_line":"            else:"},{"line_number":377,"context_line":"                if not chunk:"},{"line_number":378,"context_line":"                    start_response_args[0][1].append((\u0027Content-Length\u0027, \u00270\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_1a4ce7c6","line":375,"updated":"2020-10-03 04:31:37.000000000","message":"What about importing enforce_byte_count from catch_errors and wrapping the iterator here? Something like\n\n if h.lower() \u003d\u003d \u0027content-length\u0027:\n     iterable \u003d enforce_byte_count(iterable, int(v) - len(chunk))\n     break\n elif h.lower() \u003d\u003d \u0027transfer-encoding\u0027:\n     break\n\nGets even cleaner if we use reiterate instead of holding on to the leading chunk ourselves...","commit_id":"a52aebb4c8df885206c5fa14ee0c6e36a351786c"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3812f8ba8d3ddb304181e9fd785107008c8f4fa9","unresolved":false,"context_lines":[{"line_number":376,"context_line":"                    break"},{"line_number":377,"context_line":"            else:"},{"line_number":378,"context_line":"                if not chunk:"},{"line_number":379,"context_line":"                    start_response_args[0][1].append((\u0027Content-Length\u0027, \u00270\u0027))"},{"line_number":380,"context_line":"                elif isinstance(iterable, list):"},{"line_number":381,"context_line":"                    start_response_args[0][1].append("},{"line_number":382,"context_line":"                        (\u0027Content-Length\u0027, str(sum(len(i) for i in iterable))))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_a138b89e","side":"PARENT","line":379,"updated":"2020-10-12 20:57:58.000000000","message":"I think this would add content-length: 0 to a generator like:\n\n    def g(): yield \u0027\u0027; yield \u0027\u0027; yield \u0027\u0027\n\n... which would have been drained above\n\ni don\u0027t know if we\u0027ve carried that behavior forward","commit_id":"4236a6efa34f6f8196a747d40911f2d37c3c4036"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3812f8ba8d3ddb304181e9fd785107008c8f4fa9","unresolved":false,"context_lines":[{"line_number":418,"context_line":"                client_disconnect \u003d True"},{"line_number":419,"context_line":"                raise"},{"line_number":420,"context_line":"            except Exception:"},{"line_number":421,"context_line":"                start_status \u003d 500"},{"line_number":422,"context_line":"                raise"},{"line_number":423,"context_line":"            finally:"},{"line_number":424,"context_line":"                status_int \u003d status_int_for_logging("}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_66b6e48b","line":421,"updated":"2020-10-12 20:57:58.000000000","message":"oh, hrm... did I do this?  suddenly, in this context it feels a little weird to call it \"start\" status","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"}],"swift/common/middleware/versioned_writes/object_versioning.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f49b8f5c350c3d8851e3570b495a115e8ea19e60","unresolved":false,"context_lines":[{"line_number":397,"context_line":"            # missing container or bad permissions"},{"line_number":398,"context_line":"            if resp.status_int \u003d\u003d 404:"},{"line_number":399,"context_line":"                raise HTTPPreconditionFailed(request\u003dreq)"},{"line_number":400,"context_line":"            raise HTTPException(body\u003dresp.body, status\u003dresp.status,"},{"line_number":401,"context_line":"                                headers\u003dresp.headers)"},{"line_number":402,"context_line":"        # could not version the data, bail"},{"line_number":403,"context_line":"        raise HTTPServiceUnavailable(request\u003dreq)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_2042350e","side":"PARENT","line":400,"range":{"start_line":400,"start_character":37,"end_line":400,"end_character":46},"updated":"2020-10-07 01:08:25.000000000","message":"I\u0027d been seeing short reads here since resp.headers had a Content-Length but we already drained \u0026 closed the response.","commit_id":"4236a6efa34f6f8196a747d40911f2d37c3c4036"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3812f8ba8d3ddb304181e9fd785107008c8f4fa9","unresolved":false,"context_lines":[{"line_number":399,"context_line":"            # missing container or bad permissions"},{"line_number":400,"context_line":"            if resp.status_int \u003d\u003d 404:"},{"line_number":401,"context_line":"                raise HTTPPreconditionFailed(request\u003dreq)"},{"line_number":402,"context_line":"            raise HTTPException(body\u003dbody, status\u003dresp.status,"},{"line_number":403,"context_line":"                                headers\u003dresp.headers)"},{"line_number":404,"context_line":"        # could not version the data, bail"},{"line_number":405,"context_line":"        raise HTTPServiceUnavailable(request\u003dreq)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_47ce0c83","line":402,"updated":"2020-10-12 20:57:58.000000000","message":"it would have been great to break these out a separate patch - I don\u0027t think we have any unittests covering this change in test_object_versioning or test_versioned_writes","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"}],"swift/proxy/controllers/obj.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f49b8f5c350c3d8851e3570b495a115e8ea19e60","unresolved":false,"context_lines":[{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"    def __iter__(self):"},{"line_number":1202,"context_line":"        if self.stashed_iter is not None:"},{"line_number":1203,"context_line":"            return self"},{"line_number":1204,"context_line":"        else:"},{"line_number":1205,"context_line":"            raise ValueError(\"Failed to call kickoff() before __iter__()\")"},{"line_number":1206,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_604c2d3f","line":1203,"updated":"2020-10-07 01:08:25.000000000","message":"I still think this shuffling of things might address https://bugs.launchpad.net/swift/+bug/1895739 -- I\u0027ve got this applied in the cluster where I\u0027d seen the problem, will have to see whether it happens again...","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3812f8ba8d3ddb304181e9fd785107008c8f4fa9","unresolved":false,"context_lines":[{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"    def __iter__(self):"},{"line_number":1202,"context_line":"        if self.stashed_iter is not None:"},{"line_number":1203,"context_line":"            return self"},{"line_number":1204,"context_line":"        else:"},{"line_number":1205,"context_line":"            raise ValueError(\"Failed to call kickoff() before __iter__()\")"},{"line_number":1206,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_87a784a8","line":1203,"in_reply_to":"9f560f44_498c912d","updated":"2020-10-12 20:57:58.000000000","message":"this seemed to be driving a lot of the change in CloseableChain over in utils - FWIW it seems like it was getting covered by ... crypto unittests?","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7b7755be210a53cbbfd2db50f9fd9d57578cd330","unresolved":false,"context_lines":[{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"    def __iter__(self):"},{"line_number":1202,"context_line":"        if self.stashed_iter is not None:"},{"line_number":1203,"context_line":"            return self"},{"line_number":1204,"context_line":"        else:"},{"line_number":1205,"context_line":"            raise ValueError(\"Failed to call kickoff() before __iter__()\")"},{"line_number":1206,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_498c912d","line":1203,"in_reply_to":"9f560f44_604c2d3f","updated":"2020-10-08 21:38:34.000000000","message":"Nope, wishful thinking I guess... still see the occasional deadlock with this applied. It may be necessary, but it\u0027s *not* sufficient.","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"}],"test/unit/common/middleware/test_proxy_logging.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"395d3e109fde83de7a325a80b2ed619c1ecb5607","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            is_container_or_object_req \u003d False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        headers \u003d [(\u0027Content-Type\u0027, \u0027text/plain\u0027)]"},{"line_number":55,"context_line":"        if not hasattr(self.body, \u0027close\u0027):"},{"line_number":56,"context_line":"            content_length \u003d sum(map(len, self.body))"},{"line_number":57,"context_line":"            headers.append((\u0027Content-Length\u0027, str(content_length)))"},{"line_number":58,"context_line":"        if is_container_or_object_req and self.policy_idx is not None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_c2cd7c31","line":55,"updated":"2020-10-01 22:15:34.000000000","message":"Maybe better as\n\n if isinstance(self.body, list)\n\n? The only other non-list is that CloseableBody.\n\nI\u0027m not really sure what the point is of us doing this, though -- if I just drop it entirely, nothing breaks :-/","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"a854350c1aa3801c18ca21ff0dc12cd0f373aa47","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        headers \u003d [(\u0027Content-Type\u0027, \u0027text/plain\u0027)]"},{"line_number":55,"context_line":"        if not hasattr(self.body, \u0027close\u0027):"},{"line_number":56,"context_line":"            content_length \u003d sum(map(len, self.body))"},{"line_number":57,"context_line":"            headers.append((\u0027Content-Length\u0027, str(content_length)))"},{"line_number":58,"context_line":"        if is_container_or_object_req and self.policy_idx is not None:"},{"line_number":59,"context_line":"            headers.append((\u0027X-Backend-Storage-Policy-Index\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_08915354","line":56,"updated":"2020-10-02 02:28:39.000000000","message":"for me, before i refactored, calculating content_length blew up before getting a response","commit_id":"1dc11615db1ee3350405438909a18624443af2d5"},{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3812f8ba8d3ddb304181e9fd785107008c8f4fa9","unresolved":false,"context_lines":[{"line_number":712,"context_line":"            resp.body"},{"line_number":713,"context_line":"        self.assertEqual(\u0027kaboom!\u0027, str(ctx.exception))"},{"line_number":714,"context_line":"        log_parts \u003d self._log_parts(app)"},{"line_number":715,"context_line":"        self.assertEqual(log_parts, [\u0027GET\u0027, \u0027/\u0027, \u0027500\u0027, \u0027200\u0027])"},{"line_number":716,"context_line":""},{"line_number":717,"context_line":"    def test_disconnect_on_readline(self):"},{"line_number":718,"context_line":"        app \u003d proxy_logging.ProxyLoggingMiddleware(FakeAppReadline(), {})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_899ea9b4","line":715,"updated":"2020-10-12 20:57:58.000000000","message":"I still like this little test :+1:","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"}],"test/unit/common/test_utils.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"3812f8ba8d3ddb304181e9fd785107008c8f4fa9","unresolved":false,"context_lines":[{"line_number":1262,"context_line":"        utils.drain_and_close(Response(status\u003d200, body\u003db\u0027Some body\u0027))"},{"line_number":1263,"context_line":"        drained \u003d [False]"},{"line_number":1264,"context_line":"        utils.drain_and_close(Response(status\u003d200, app_iter\u003dgen()))"},{"line_number":1265,"context_line":"        self.assertTrue(drained[0])"},{"line_number":1266,"context_line":""},{"line_number":1267,"context_line":"    def test_backwards(self):"},{"line_number":1268,"context_line":"        # Test swift.common.utils.backward"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_299dddba","line":1265,"updated":"2020-10-12 20:57:58.000000000","message":"i like this test too!","commit_id":"fb08d477eb7bf5e678b9cd99b44a435842a7dfbf"}]}
