)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"8fe564f672f0866c5a7111b49a8b42e770e39046","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b8e8ce07_a0060b68","updated":"2025-02-24 09:27:12.000000000","message":"Hello,\n\nThanks for this fix.\nWould be good to have a release note.","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"bbbfa5195172bae61d238067986c62fd6d51d510","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"95da9edd_9c1ca98a","in_reply_to":"60c4181b_c76602dd","updated":"2025-02-24 15:02:31.000000000","message":"@Artem\n\nUnfortunately I don\u0027t have a handy deployment to test 942435 actually. It\u0027d be really nice if you can try it in your env (with services using eventlet such as nova) and share your feedback...\nThe hack was added to workaround an expected problem caused by eventlet thread + api servers deployed with uwsgi but I\u0027m not quite sure the said problem is really impactful or not based on the past discussion.","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":29525,"name":"Artem Vasilyev","email":"artem.v.vasilyev@gmail.com","username":"artem.v.vasilyev"},"change_message_id":"7aafc411c4f1d36760164808b4149b572e6c8627","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"cfdab498_e29b6441","in_reply_to":"95da9edd_9c1ca98a","updated":"2025-02-24 18:01:22.000000000","message":"Performed several tests with my setup:\nNova Zed release with backported changes to oslo.messaging 14.0.3.\nNova API is running behind uWSGI (configured with a single process and single thread for easier debugging).\nOslo.messaging metrics are enabled. Testing involved retrieving the serial console via the API.\n\nFirst test: Completely remove threading unpatching\n- Sent the first request to the API: observed the rpc_client_invocation_start_total metric in oslo-metrics.\n- Sent the second request: observed rpc_client_invocation_end_total from the previous request and rpc_client_invocation_start_total from the new request.\n\nSubsequent requests repeated this pattern: rpc_client_invocation_end_total remained queued until the next request was sent.\n\n\nSecond test: Unpatch threading, queue, and socket\n\n- Sent the first request: observed both rpc_client_invocation_start_total and rpc_client_invocation_end_total for this request.\n- Sent the second request: observed both rpc_client_invocation_start_total and rpc_client_invocation_end_total for this request.\n\nThese case works as supposed to, but it still mixes native threads with eventlets.\n\nThird test: Completely remove threading unpatching and add time.sleep(0) at the end of put_into_tx_queue (https://github.com/openstack/oslo.messaging/blob/master/oslo_messaging/_metrics/client.py#L99)\n\n- Sent the first request: observed both rpc_client_invocation_start_total and rpc_client_invocation_end_total for this request.\n- Sent the second request: observed both rpc_client_invocation_start_total and rpc_client_invocation_end_total for this request.\n\n\nConclusion:\nThe best approach appears to be removing the unpatch (as suggested by @kajinamit) and adding the time.sleep(0) workaround.","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":29525,"name":"Artem Vasilyev","email":"artem.v.vasilyev@gmail.com","username":"artem.v.vasilyev"},"change_message_id":"2e0992205acbbbbe7f73a47b0590f0c8cc4cd68e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d4170701_07465d5b","in_reply_to":"b8e8ce07_a0060b68","updated":"2025-02-24 10:39:09.000000000","message":"Thanks, I’ve added the release note. However, after discussing with kajinamit, I\u0027m uncertain whether to fix this bug or fully remove the native thread. I noticed there’s a conflicting patchset that removes native thread from the metrics client: https://review.opendev.org/c/openstack/oslo.messaging/+/942435","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":29525,"name":"Artem Vasilyev","email":"artem.v.vasilyev@gmail.com","username":"artem.v.vasilyev"},"change_message_id":"ac0b6e4cce2817d7efa8232130fc36aa458e46e3","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"c90d49fd_6f1d4924","in_reply_to":"ca4fb9e4_38bc333e","updated":"2025-02-28 14:36:15.000000000","message":"Thanks! So I\u0027ll abandon my changeset","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"c0f912b72cafdee0ec87339ca4b9b8307d2944a6","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"ca4fb9e4_38bc333e","in_reply_to":"cfdab498_e29b6441","updated":"2025-02-28 13:53:08.000000000","message":"Thanks. I\u0027ve updated my change with your suggestion addressed and you added as an co-author !\n\nhttps://review.opendev.org/c/openstack/oslo.messaging/+/942435","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"aff67ece5bb961e047377d5ece13469693a92ed6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"60c4181b_c76602dd","in_reply_to":"d4170701_07465d5b","updated":"2025-02-24 14:11:39.000000000","message":"Indeed, that\u0027s an alternative.\nI agree with Takashi, mixing native threads and green threads, cause much pain than they solve things, so yes, maybe simply removing this kind of hack is the right thing to do.","commit_id":"2c6408381307976128bdf52f7344232edd91fbc3"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"034f01f733e33e58e692d0dc1d2f040439d8ddec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"0d758478_3f10d0dc","updated":"2025-02-24 14:08:13.000000000","message":"Thanks","commit_id":"0ba183327af05823f5f1eb65dba79b003f3947eb"},{"author":{"_account_id":11583,"name":"Arnaud Morin","email":"arnaud.morin@gmail.com","username":"arnaudmorin"},"change_message_id":"50e63e3e48ef1d9bbda1f89b19beace924f1ac90","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ae070668_05b9ede3","updated":"2025-02-24 16:34:37.000000000","message":"it\u0027s not enough","commit_id":"0ba183327af05823f5f1eb65dba79b003f3947eb"}],"oslo_messaging/_metrics/client.py":[{"author":{"_account_id":11583,"name":"Arnaud Morin","email":"arnaud.morin@gmail.com","username":"arnaudmorin"},"change_message_id":"50e63e3e48ef1d9bbda1f89b19beace924f1ac90","unresolved":true,"context_lines":[{"line_number":31,"context_line":"    # Here we initialize module with the native python threading module"},{"line_number":32,"context_line":"    # if it was already monkey patched by eventlet/greenlet."},{"line_number":33,"context_line":"    stdlib_threading \u003d eventlet.patcher.original(\u0027threading\u0027)"},{"line_number":34,"context_line":"    stdlib_queue \u003d eventlet.patcher.original(\u0027queue\u0027)"},{"line_number":35,"context_line":"else:"},{"line_number":36,"context_line":"    # Manage the case where we run this driver in a non patched environment"},{"line_number":37,"context_line":"    # and where user even so configure the driver to run heartbeat through"}],"source_content_type":"text/x-python","patch_set":2,"id":"ef3186f1_4bb40890","line":34,"updated":"2025-02-24 16:34:37.000000000","message":"Even more that that, what we did on our downstream repo is also restoring the socket:\n\n`stdlib_socket \u003d eventlet.patcher.original(\u0027socket\u0027)`\n\nand patched the socket line 136 to use it.\nOtherwise, we had issues","commit_id":"0ba183327af05823f5f1eb65dba79b003f3947eb"},{"author":{"_account_id":11583,"name":"Arnaud Morin","email":"arnaud.morin@gmail.com","username":"arnaudmorin"},"change_message_id":"6d7b50f97b0d0ad235d3a9c1db3cde6497920643","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                time.sleep(1)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def send_metric(self, metric):"},{"line_number":138,"context_line":"        s \u003d socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)"},{"line_number":139,"context_line":"        s.connect(self.unix_socket)"},{"line_number":140,"context_line":"        s.send(metric.to_json().encode())"},{"line_number":141,"context_line":"        s.close()"}],"source_content_type":"text/x-python","patch_set":2,"id":"42f71200_03a6e23b","line":138,"updated":"2025-02-24 16:35:38.000000000","message":"here","commit_id":"0ba183327af05823f5f1eb65dba79b003f3947eb"}]}
