)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"dfcbaf811adf5e74defd061155e6c7a2df40f05e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1ebc961e_a3c8d341","updated":"2026-08-12 22:38:51.000000000","message":"All the nested tries feel like a bit of a smell, but I don\u0027t see anything obviously wrong (or simplifiable) to them.\n\nHow on earth did you stumble upon this??","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b99aca79c7e537844622a1e41690f7fd09128553","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3c7d43ee_5b5993aa","updated":"2026-08-13 01:01:34.000000000","message":"Basically otel spans where coming back as successful when something happened during the body iter. Because the spans only lived until the return of the headers, and at that time it already has a status code (except for SLO where it\u0027s iter is intrumented).\n\nSo was looking into wrapping the app_iter for tracing and then ending/closing the span and trace on close of the iter. However, AI was testing and generated tests found trying to use the call_application write for testing wasn\u0027t closing the iter, so the span surrounding the iter/body wasn\u0027t being closed.","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"}],"swift/common/swob.py":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"dfcbaf811adf5e74defd061155e6c7a2df40f05e","unresolved":true,"context_lines":[{"line_number":1139,"context_line":"        app_iter \u003d application(self.environ, start_response)"},{"line_number":1140,"context_line":"        try:"},{"line_number":1141,"context_line":"            substitute_buffer \u003d not app_iter"},{"line_number":1142,"context_line":"        except BaseException:"},{"line_number":1143,"context_line":"            # the iterable cannot even be evaluated, so it cannot be"},{"line_number":1144,"context_line":"            # returned either; release it rather than leaking it, but the"},{"line_number":1145,"context_line":"            # original failure is the one the caller needs to see"}],"source_content_type":"text/x-python","patch_set":1,"id":"2612b099_e3e33827","line":1142,"range":{"start_line":1142,"start_character":15,"end_line":1142,"end_character":28},"updated":"2026-08-12 22:38:51.000000000","message":"How many ways do we really expect this to be able to fail? How have you seen it fail?","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b99aca79c7e537844622a1e41690f7fd09128553","unresolved":true,"context_lines":[{"line_number":1139,"context_line":"        app_iter \u003d application(self.environ, start_response)"},{"line_number":1140,"context_line":"        try:"},{"line_number":1141,"context_line":"            substitute_buffer \u003d not app_iter"},{"line_number":1142,"context_line":"        except BaseException:"},{"line_number":1143,"context_line":"            # the iterable cannot even be evaluated, so it cannot be"},{"line_number":1144,"context_line":"            # returned either; release it rather than leaking it, but the"},{"line_number":1145,"context_line":"            # original failure is the one the caller needs to see"}],"source_content_type":"text/x-python","patch_set":1,"id":"1ec4710b_88147b26","line":1142,"range":{"start_line":1142,"start_character":15,"end_line":1142,"end_character":28},"in_reply_to":"2612b099_e3e33827","updated":"2026-08-13 01:01:34.000000000","message":"This all came from me wanting to wrap the iter in a tracing iter, and ai generated tests found trying to use the call_application write for testing wasn\u0027t closing the iter, or rather the span didn\u0027t know to close the span because the wrapper never got the close() call.\n\nBecause the swob req.call_application is so high level, we have no idea what\u0027s going to be returned. A simple bool check above may not because a `__bool__` may not exist, which it then falls back to `__len__`, if none of these work, bool can fail. And sure probably an Exception would be enough.. however there is a theoretical possability thanks to eventlet that during call call to `__bool__` or `__len__`, esp if a socket or something was touched, that a Timeout or a GreenletExit (if green thread was killed) and these inherit directly from BaseException. Meaning they wont get detected and cause a leak.\nI guess I could do something like:\n```\nexcept (eventlet.Timeout, GreenletExit, Exception):\n```\n\nAnd be more specific, but because it\u0027s a higher level call, ie is at the top of the wsgi stack and who knows which middleswares it\u0027ll tracverse, maybe there are other BaseException or Errors that need to be blocked 🤷","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"dfcbaf811adf5e74defd061155e6c7a2df40f05e","unresolved":true,"context_lines":[{"line_number":1146,"context_line":"            try:"},{"line_number":1147,"context_line":"                close_if_possible(app_iter)"},{"line_number":1148,"context_line":"            except Exception:"},{"line_number":1149,"context_line":"                pass"},{"line_number":1150,"context_line":"            raise"},{"line_number":1151,"context_line":"        discarded \u003d None"},{"line_number":1152,"context_line":"        if substitute_buffer:"}],"source_content_type":"text/x-python","patch_set":1,"id":"33291780_eca6b739","line":1149,"updated":"2026-08-12 22:38:51.000000000","message":"This pattern (repeated below) makes me wonder if we want some `quiet_close_if_possible` helper or something...","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b99aca79c7e537844622a1e41690f7fd09128553","unresolved":true,"context_lines":[{"line_number":1146,"context_line":"            try:"},{"line_number":1147,"context_line":"                close_if_possible(app_iter)"},{"line_number":1148,"context_line":"            except Exception:"},{"line_number":1149,"context_line":"                pass"},{"line_number":1150,"context_line":"            raise"},{"line_number":1151,"context_line":"        discarded \u003d None"},{"line_number":1152,"context_line":"        if substitute_buffer:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3e8d633d_2f1817e9","line":1149,"in_reply_to":"33291780_eca6b739","updated":"2026-08-13 01:01:34.000000000","message":"The point here is to still raise the exception, but at least attempt to close the iter.","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":38368,"name":"Christian Ohanaja","display_name":"Christian Ohanaja","email":"cohanaja@nvidia.com","username":"cohanaja"},"change_message_id":"6f160c9beaece8736dd7c7b30f8ed936b1b58598","unresolved":true,"context_lines":[{"line_number":1158,"context_line":"            # tracks its own lifecycle sees why it is being released."},{"line_number":1159,"context_line":"            discarded \u003d app_iter"},{"line_number":1160,"context_line":"            app_iter \u003d output"},{"line_number":1161,"context_line":"        if not captured:"},{"line_number":1162,"context_line":"            app_iter \u003d reiterate(app_iter)"},{"line_number":1163,"context_line":"        if not captured:"},{"line_number":1164,"context_line":"            try:"},{"line_number":1165,"context_line":"                raise RuntimeError("},{"line_number":1166,"context_line":"                    \u0027application never called start_response\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5acdfe73_f8a143d1","line":1163,"range":{"start_line":1161,"start_character":8,"end_line":1163,"end_character":24},"updated":"2026-08-12 17:45:21.000000000","message":"Wish if #2 was nested here but outside that, LGTM!","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b99aca79c7e537844622a1e41690f7fd09128553","unresolved":true,"context_lines":[{"line_number":1158,"context_line":"            # tracks its own lifecycle sees why it is being released."},{"line_number":1159,"context_line":"            discarded \u003d app_iter"},{"line_number":1160,"context_line":"            app_iter \u003d output"},{"line_number":1161,"context_line":"        if not captured:"},{"line_number":1162,"context_line":"            app_iter \u003d reiterate(app_iter)"},{"line_number":1163,"context_line":"        if not captured:"},{"line_number":1164,"context_line":"            try:"},{"line_number":1165,"context_line":"                raise RuntimeError("},{"line_number":1166,"context_line":"                    \u0027application never called start_response\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"676c9c8d_a0a949f4","line":1163,"range":{"start_line":1161,"start_character":8,"end_line":1163,"end_character":24},"in_reply_to":"5acdfe73_f8a143d1","updated":"2026-08-13 01:01:34.000000000","message":"Yeah I thought that was weird too. But it was in the original code, so just left it. But I guess I should clean it up while working here.","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"dfcbaf811adf5e74defd061155e6c7a2df40f05e","unresolved":true,"context_lines":[{"line_number":1171,"context_line":"                except Exception:"},{"line_number":1172,"context_line":"                    pass"},{"line_number":1173,"context_line":"        if discarded is not None:"},{"line_number":1174,"context_line":"            close_if_possible(discarded)"},{"line_number":1175,"context_line":"        return (captured[0], captured[1], app_iter)"},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"    def get_response(self, application):"}],"source_content_type":"text/x-python","patch_set":1,"id":"096cfcbf_0612cad0","line":1174,"updated":"2026-08-12 22:38:51.000000000","message":"No `except Exception: pass` here? Why in the other places, but not here?\n\nSeparately, I wonder how likely `discarded` is to actually be closeable -- seems most likely that the app would have returned `[]` or `None`...","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"b99aca79c7e537844622a1e41690f7fd09128553","unresolved":true,"context_lines":[{"line_number":1171,"context_line":"                except Exception:"},{"line_number":1172,"context_line":"                    pass"},{"line_number":1173,"context_line":"        if discarded is not None:"},{"line_number":1174,"context_line":"            close_if_possible(discarded)"},{"line_number":1175,"context_line":"        return (captured[0], captured[1], app_iter)"},{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"    def get_response(self, application):"}],"source_content_type":"text/x-python","patch_set":1,"id":"95985a29_80b7f6f4","line":1174,"in_reply_to":"096cfcbf_0612cad0","updated":"2026-08-13 01:01:34.000000000","message":"If there is an issue here we may want it to raise up was my thinking.. but yeah, seeing as it\u0027s close_if_possible on second thought we want to just try and close, so yeah `Exception: pass` probably makes more sense.\n\nyeah fair point, it was more to cover bases, but at least we try and close it.","commit_id":"91914b37b89296544989ba33e87d38a3b0318239"}]}
