)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b1444561aa71bacd7a168a4961b0e2dde5bbe593","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b61f0412_79a37a6f","updated":"2024-12-09 20:36:34.000000000","message":"The more I think about this, the more certain I become that this is going to need to be a behavior that clients opt into. Maybe a `?heartbeat\u003don` query param, like is done with SLO?","commit_id":"dff00b4b4afdc6fe80cf97e2360ead66897aeaf8"}],"swift/common/middleware/copy.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b1444561aa71bacd7a168a4961b0e2dde5bbe593","unresolved":true,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def send_put_req(self, req, additional_resp_headers, start_response):"},{"line_number":192,"context_line":"        req.environ[\u0027eventlet.minimum_write_chunk_size\u0027] \u003d 0"},{"line_number":193,"context_line":"        app_resp \u003d self._app_call(req.environ)"},{"line_number":194,"context_line":"        if is_success(self._get_status_int()):"},{"line_number":195,"context_line":"            self._adjust_put_response(req, additional_resp_headers)"},{"line_number":196,"context_line":"        start_response(self._response_status, self._response_headers,"}],"source_content_type":"text/x-python","patch_set":1,"id":"20c5656e_d3c7bdb9","line":193,"updated":"2024-12-09 20:36:34.000000000","message":"I\u0027m pretty sure most/all of the wall-time during a copy will be spent waiting on this, since the proxy-server app won\u0027t know whether to respond with a 2xx, 4xx, or 5xx until it finishes processing the PUT. Adding some rudimentary profiling like https://paste.opendev.org/show/bh7lUvcKue3PZGTEIybD/ and copying a 100M object in my VSAIO, I see timings like\n```\nGetting source response: 0.000 (txn: txa6f1ea5ca3584db493c4e-0067574ee5)\nGot source response: 0.049 (txn: txa6f1ea5ca3584db493c4e-0067574ee5)\nSending put req: 0.050 (txn: txa6f1ea5ca3584db493c4e-0067574ee5)\nGot put response headers: 1.241 (txn: txa6f1ea5ca3584db493c4e-0067574ee5) (client_ip: 127.0.0.1)\nCompleted put response: 1.241 (txn: txa6f1ea5ca3584db493c4e-0067574ee5) (client_ip: 127.0.0.1)\n```\nI think we\u0027re going to need something like\n```\ngt \u003d eventlet.spawn(self._app_call, req.environ)\nwhile not gt.dead:\n    try:\n        with eventlet.Timeout(self.yield_frequency):\n            app_resp \u003d gt.wait()\n    except eventlet.Timeout:\n        yield b\u0027 \u0027\n```\nto spawn a greenthread and yield out heartbeats while waiting on the response.","commit_id":"dff00b4b4afdc6fe80cf97e2360ead66897aeaf8"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b1444561aa71bacd7a168a4961b0e2dde5bbe593","unresolved":true,"context_lines":[{"line_number":225,"context_line":"    def _adjust_put_response(self, req, additional_resp_headers):"},{"line_number":226,"context_line":"        if is_success(self._get_status_int()):"},{"line_number":227,"context_line":"            for header, value in additional_resp_headers.items():"},{"line_number":228,"context_line":"                self._response_headers.append((header, value))"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def handle_OPTIONS_request(self, req, start_response):"},{"line_number":231,"context_line":"        app_resp \u003d self._app_call(req.environ)"}],"source_content_type":"text/x-python","patch_set":1,"id":"77e57113_9bf3a4f2","line":228,"updated":"2024-12-09 20:36:34.000000000","message":"Hmm... if we\u0027re going to start yielding bytes before we\u0027ve got the final PUT status, we\u0027ll need to have called `start_response` (probably with a `202 Accepted`?) before then -- so we\u0027ll need to make sure these header updates make it into the response body (since headers will already be sent).","commit_id":"dff00b4b4afdc6fe80cf97e2360ead66897aeaf8"}]}
