)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"fdd0fa380f9ec957254a7cea8d2a9777bee6ce80","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"fe2eebe0_6fd4bc64","updated":"2026-07-14 13:38:42.000000000","message":"Helen, sorry for the spam. I used Claude for the `weakref` information. I gave it the gerrit link too. But the harness (`do not write anything in gerrit`) didn\u0027t work.\n\nAgain, sorry for the spam","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":38298,"name":"Helen Chen","display_name":"Helen Chen","email":"ichen@redhat.com","username":"ingwherchen"},"change_message_id":"f597e35a77d7e562eec7b21576067e25ed469a5b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0170c9a8_6f305de2","in_reply_to":"fe2eebe0_6fd4bc64","updated":"2026-07-14 13:46:50.000000000","message":"No problem.  I appreciate the explanation and will switch to weakref.","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"}],"neutron/agent/linux/nl_dispatcher.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"8f02d030ef650a35267dc89d49a6f6287136b5c1","unresolved":true,"context_lines":[{"line_number":43,"context_line":"        self._groups \u003d groups"},{"line_number":44,"context_line":"        self._replay_start_callbacks \u003d []"},{"line_number":45,"context_line":"        self._replay_end_callbacks \u003d []"},{"line_number":46,"context_line":"        self._ipr \u003d None"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def register_handler(self, event_type, handler):"},{"line_number":49,"context_line":"        \"\"\"Register a handler for a specific netlink message type."}],"source_content_type":"text/x-python","patch_set":2,"id":"d03fcb89_25e721cb","line":46,"updated":"2026-07-14 13:37:01.000000000","message":"Consider using a `weakref` here so you don\u0027t need the explicit `self._ipr \u003d None` cleanup in the `finally` block.\n\nAdd `import weakref` to the imports, then init as:\n\n```\nself._ipr \u003d lambda: None\n```\n\nThis makes `self._ipr` always callable (matching the `weakref.ref` interface), returning `None` when no socket is active.","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"682882c01da676e3cef2e874f4652b5fb8a9f5e5","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self._groups \u003d groups"},{"line_number":44,"context_line":"        self._replay_start_callbacks \u003d []"},{"line_number":45,"context_line":"        self._replay_end_callbacks \u003d []"},{"line_number":46,"context_line":"        self._ipr \u003d None"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def register_handler(self, event_type, handler):"},{"line_number":49,"context_line":"        \"\"\"Register a handler for a specific netlink message type."}],"source_content_type":"text/x-python","patch_set":2,"id":"35dbbba9_5c1931e3","line":46,"in_reply_to":"d03fcb89_25e721cb","updated":"2026-07-14 15:32:48.000000000","message":"Done","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"13bc59aec06c2e5544e4caa6b2889714924cb42b","unresolved":true,"context_lines":[{"line_number":76,"context_line":"    def _sock(self):"},{"line_number":77,"context_line":"        ipr \u003d iproute.IPRoute()"},{"line_number":78,"context_line":"        ipr.bind(self._groups)"},{"line_number":79,"context_line":"        self._ipr \u003d ipr"},{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            yield ipr"},{"line_number":82,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":2,"id":"21b233f6_e3d1631e","line":79,"updated":"2026-07-14 13:37:03.000000000","message":"Use a weakref here:\n\n```\nself._ipr \u003d weakref.ref(ipr)\n```\n\nThis way callers dereference with `self._ipr()` — returns the live `IPRoute` while the context manager is active, and `None` once the object is collected.","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"682882c01da676e3cef2e874f4652b5fb8a9f5e5","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def _sock(self):"},{"line_number":77,"context_line":"        ipr \u003d iproute.IPRoute()"},{"line_number":78,"context_line":"        ipr.bind(self._groups)"},{"line_number":79,"context_line":"        self._ipr \u003d ipr"},{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            yield ipr"},{"line_number":82,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":2,"id":"d6129da3_ccf93d72","line":79,"in_reply_to":"21b233f6_e3d1631e","updated":"2026-07-14 15:32:48.000000000","message":"Done","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"ad6d934edff61cc652252f618b51a92b713c1f60","unresolved":true,"context_lines":[{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            yield ipr"},{"line_number":82,"context_line":"        finally:"},{"line_number":83,"context_line":"            self._ipr \u003d None"},{"line_number":84,"context_line":"            ipr.close()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @tenacity.retry("}],"source_content_type":"text/x-python","patch_set":2,"id":"3fdb6aa0_70ac480f","line":83,"updated":"2026-07-14 13:37:05.000000000","message":"With the weakref approach this line can be dropped — the weakref returns `None` automatically once the `IPRoute` object is garbage collected after `ipr.close()` and the local references go out of scope.","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"682882c01da676e3cef2e874f4652b5fb8a9f5e5","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        try:"},{"line_number":81,"context_line":"            yield ipr"},{"line_number":82,"context_line":"        finally:"},{"line_number":83,"context_line":"            self._ipr \u003d None"},{"line_number":84,"context_line":"            ipr.close()"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    @tenacity.retry("}],"source_content_type":"text/x-python","patch_set":2,"id":"0fe5adbe_bc13d03b","line":83,"in_reply_to":"3fdb6aa0_70ac480f","updated":"2026-07-14 15:32:48.000000000","message":"Done","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"}],"neutron/tests/functional/agent/ovn/extensions/test_evpn.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"0a4de483712b0dbd16921e6a8c704ec624d9d0b7","unresolved":true,"context_lines":[{"line_number":51,"context_line":"                               side_effect\u003dSystemExit):"},{"line_number":52,"context_line":"            with mock.patch.object(iproute, \u0027IPRoute\u0027,"},{"line_number":53,"context_line":"                                   side_effect\u003dRuntimeError):"},{"line_number":54,"context_line":"                if dispatcher._ipr:"},{"line_number":55,"context_line":"                    dispatcher._ipr.close()"},{"line_number":56,"context_line":"                try:"},{"line_number":57,"context_line":"                    dispatcher._thread.join(timeout\u003d5)"}],"source_content_type":"text/x-python","patch_set":2,"id":"449d3a53_bafb1f11","line":54,"updated":"2026-07-14 13:37:07.000000000","message":"With `_ipr` stored as a `weakref.ref`, dereference it with a call:\n\n```\nipr \u003d dispatcher._ipr()\nif ipr:\n    ipr.close()\n```","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"682882c01da676e3cef2e874f4652b5fb8a9f5e5","unresolved":false,"context_lines":[{"line_number":51,"context_line":"                               side_effect\u003dSystemExit):"},{"line_number":52,"context_line":"            with mock.patch.object(iproute, \u0027IPRoute\u0027,"},{"line_number":53,"context_line":"                                   side_effect\u003dRuntimeError):"},{"line_number":54,"context_line":"                if dispatcher._ipr:"},{"line_number":55,"context_line":"                    dispatcher._ipr.close()"},{"line_number":56,"context_line":"                try:"},{"line_number":57,"context_line":"                    dispatcher._thread.join(timeout\u003d5)"}],"source_content_type":"text/x-python","patch_set":2,"id":"6c9f8f03_077d1a53","line":54,"in_reply_to":"449d3a53_bafb1f11","updated":"2026-07-14 15:32:48.000000000","message":"Done","commit_id":"88d1440ca380dd4fc0d54a48f5c7058671122e45"}]}
