)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c9254fc79ae89a427fa2ff958bf0c88119028cfa","unresolved":true,"context_lines":[{"line_number":15,"context_line":"The code doing that for spawn and spawn_n"},{"line_number":16,"context_line":"is extracted to a new function"},{"line_number":17,"context_line":"and called to submit the work to the thread-pools."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I9085deaa8cf0b167d87db68e4afc4a463c00569c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9e422247_d5b2659a","line":18,"updated":"2022-02-22 11:24:02.000000000","message":"can you file a bug for this","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":false,"context_lines":[{"line_number":15,"context_line":"The code doing that for spawn and spawn_n"},{"line_number":16,"context_line":"is extracted to a new function"},{"line_number":17,"context_line":"and called to submit the work to the thread-pools."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I9085deaa8cf0b167d87db68e4afc4a463c00569c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"267318ca_e521f035","line":18,"in_reply_to":"9e422247_d5b2659a","updated":"2022-03-01 15:36:49.000000000","message":"Done","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c9254fc79ae89a427fa2ff958bf0c88119028cfa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"aa4e1244_b28a09df","updated":"2022-02-22 11:24:02.000000000","message":"if you dont want to use a decorator i guess that is fine too the -1 is just since you dont have a bug filed.\nif you file that im fine with using your current design and will upgrade my vote.\n\ni have not tested the psudo code by the way i just wonder if a decorator or similar would be more useful to ensure that we never forget to add the context when we shoudl by omiting the pass_context function call at the call sight vs taging the function in its defintion sight.","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"86b315436c2eb0e254c6740a8c2521288fd2d1a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"6f16a088_57d01ec6","updated":"2022-02-22 11:06:17.000000000","message":"recheck","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d42630b61bbca91e279e4dc2d6123ea9b77f1943","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"84208976_a29ed3b1","in_reply_to":"83d8e374_1cce1c0e","updated":"2022-03-23 14:42:05.000000000","message":"ack i think we can move forward with the current approch.\n\nthe only advantage of a decorator is moving the use of it to the function defintion site rather than where its called but since this is more or less encapsulate by the util functions already i think it does not buy use enough to account for the reduction in flexablity so lets just use your current approch.","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"83d8e374_1cce1c0e","in_reply_to":"aa4e1244_b28a09df","updated":"2022-03-01 15:36:49.000000000","message":"I\u0027ve filed a bug and referenced it.\n\nMy difficulty with a decorator was, that it is used to modify the decorated function in the definition, while here we need to inject something depending on the callers site.\n\nThe cleanest solution would probably be to wrap the pools the same way the other spawn functions are wrapped.","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"ba27882c_5a648b6a","updated":"2022-03-01 15:36:49.000000000","message":"Thanks for the feedback,\n\nI found some more places which create threads and do not pass the context,\nand modified them too.\n\nI am not sure about using a decorator, as I cannot come up with an implementation which makes works things easier.\n\nI think, the cleanest solution would be to wrap the pool objects the same way as the spawn(n) functions are wrapped, and a simple grep should reveal the use of the wrong objects.\n\nBut that would mean a bigger delta.","commit_id":"a43b445f08a682451642860a7a893272c6dea8fb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d42630b61bbca91e279e4dc2d6123ea9b77f1943","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"b2183922_412aae55","updated":"2022-03-23 14:42:05.000000000","message":"i think this is good over all it would be nice if you could add some additional unit tests for the pass_context function to ensure it correctly sets them ","commit_id":"a43b445f08a682451642860a7a893272c6dea8fb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f874397b2fd435f73e4c54715a8d58b0096204a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"e7a59257_c1734f4d","updated":"2023-01-13 05:24:31.000000000","message":"sylvain can you take a look at this i would like to get it merged its been open for a while without much review","commit_id":"646fc51732b60b46385ceff0c7ea2c23372bbd72"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bb81719c58beba3c57eaa76eea4c2830e88c34a2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"71c61b8e_6aed9411","updated":"2022-08-11 00:08:40.000000000","message":"thanks for the rebase rajesh.\n\nwhile this could have a release note i dont actully think there is anything that operators would be particalarly interested in so im fine with not having one for this.\n\nthat said if there is another revision then i would not object if you added one.","commit_id":"646fc51732b60b46385ceff0c7ea2c23372bbd72"}],"nova/compute/manager.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c9254fc79ae89a427fa2ff958bf0c88119028cfa","unresolved":true,"context_lines":[{"line_number":9717,"context_line":"                        {\u0027num_db_instances\u0027: num_db_instances,"},{"line_number":9718,"context_line":"                         \u0027num_vm_instances\u0027: num_vm_instances})"},{"line_number":9719,"context_line":""},{"line_number":9720,"context_line":"        def _sync(db_instance):"},{"line_number":9721,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":9722,"context_line":"            #                two separate sources, the driver and the database."},{"line_number":9723,"context_line":"            #                They are set (in stop_instance) and read, in sync."}],"source_content_type":"text/x-python","patch_set":2,"id":"5a66af00_d8dc8773","line":9720,"range":{"start_line":9720,"start_character":8,"end_line":9720,"end_character":31},"updated":"2022-02-22 11:24:02.000000000","message":"as noted latere you coudl make pass_context a decorator and since tghis is a nested funciton you will have access to self so you can decorate thisas\n\n@nova.utiles.pass_context(self._sync_power_pool.spawn_n)","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":true,"context_lines":[{"line_number":9717,"context_line":"                        {\u0027num_db_instances\u0027: num_db_instances,"},{"line_number":9718,"context_line":"                         \u0027num_vm_instances\u0027: num_vm_instances})"},{"line_number":9719,"context_line":""},{"line_number":9720,"context_line":"        def _sync(db_instance):"},{"line_number":9721,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":9722,"context_line":"            #                two separate sources, the driver and the database."},{"line_number":9723,"context_line":"            #                They are set (in stop_instance) and read, in sync."}],"source_content_type":"text/x-python","patch_set":2,"id":"62662474_cc4fa7c4","line":9720,"range":{"start_line":9720,"start_character":8,"end_line":9720,"end_character":31},"in_reply_to":"5a66af00_d8dc8773","updated":"2022-03-01 15:36:49.000000000","message":"I am not sure that I am clear on this.\nI cannot see how it can work this way, and as well in #658.","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d42630b61bbca91e279e4dc2d6123ea9b77f1943","unresolved":false,"context_lines":[{"line_number":9717,"context_line":"                        {\u0027num_db_instances\u0027: num_db_instances,"},{"line_number":9718,"context_line":"                         \u0027num_vm_instances\u0027: num_vm_instances})"},{"line_number":9719,"context_line":""},{"line_number":9720,"context_line":"        def _sync(db_instance):"},{"line_number":9721,"context_line":"            # NOTE(melwitt): This must be synchronized as we query state from"},{"line_number":9722,"context_line":"            #                two separate sources, the driver and the database."},{"line_number":9723,"context_line":"            #                They are set (in stop_instance) and read, in sync."}],"source_content_type":"text/x-python","patch_set":2,"id":"a531564b_19a71aa9","line":9720,"range":{"start_line":9720,"start_character":8,"end_line":9720,"end_character":31},"in_reply_to":"62662474_cc4fa7c4","updated":"2022-03-23 14:42:05.000000000","message":"Ack","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c9254fc79ae89a427fa2ff958bf0c88119028cfa","unresolved":true,"context_lines":[{"line_number":9743,"context_line":"            else:"},{"line_number":9744,"context_line":"                LOG.debug(\u0027Triggering sync for uuid %s\u0027, uuid)"},{"line_number":9745,"context_line":"                self._syncs_in_progress[uuid] \u003d True"},{"line_number":9746,"context_line":"                nova.utils.pass_context(self._sync_power_pool.spawn_n,"},{"line_number":9747,"context_line":"                                        _sync,"},{"line_number":9748,"context_line":"                                        db_instance)"},{"line_number":9749,"context_line":""},{"line_number":9750,"context_line":"    def _query_driver_power_state_and_sync(self, context, db_instance):"},{"line_number":9751,"context_line":"        if db_instance.task_state is not None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"f680f88c_6d8423aa","line":9748,"range":{"start_line":9746,"start_character":16,"end_line":9748,"end_character":52},"updated":"2022-02-22 11:24:02.000000000","message":"then just do _sync(db_instance)","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":false,"context_lines":[{"line_number":9743,"context_line":"            else:"},{"line_number":9744,"context_line":"                LOG.debug(\u0027Triggering sync for uuid %s\u0027, uuid)"},{"line_number":9745,"context_line":"                self._syncs_in_progress[uuid] \u003d True"},{"line_number":9746,"context_line":"                nova.utils.pass_context(self._sync_power_pool.spawn_n,"},{"line_number":9747,"context_line":"                                        _sync,"},{"line_number":9748,"context_line":"                                        db_instance)"},{"line_number":9749,"context_line":""},{"line_number":9750,"context_line":"    def _query_driver_power_state_and_sync(self, context, db_instance):"},{"line_number":9751,"context_line":"        if db_instance.task_state is not None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"35e0e9e7_32ed1869","line":9748,"range":{"start_line":9746,"start_character":16,"end_line":9748,"end_character":52},"in_reply_to":"f680f88c_6d8423aa","updated":"2022-03-01 15:36:49.000000000","message":"Ack","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"}],"nova/utils.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c9254fc79ae89a427fa2ff958bf0c88119028cfa","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    return trace_info"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"def pass_context(runner, func, *args, **kwargs):"},{"line_number":635,"context_line":"    \"\"\"Generalised passthrough method"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    It will grab the context from the threadlocal store and add it to"}],"source_content_type":"text/x-python","patch_set":2,"id":"03860435_345aef10","line":634,"range":{"start_line":634,"start_character":4,"end_line":634,"end_character":16},"updated":"2022-02-22 11:24:02.000000000","message":"this is witten basically as a decorator so why not fully make it a decorater then decorate the  spawn and spawn_n functions with it.\n\nsomething like this\n\ndef pass_context(runner, func, *args, **kwargs):\n    \"\"\"Generalised passthrough method\n    It will grab the context from the threadlocal store and add it to\n    the store on the runner.  This allows for continuity in logging the\n    context when using this method to spawn a new thread through the\n    runner function\n    \"\"\"\n  def outer():\n    _context \u003d common_context.get_current()\n    profiler_info \u003d _serialize_profile_info()\n    @functools.wraps(func)\n    def context_wrapper(*args, **kwargs):\n        # NOTE: If update_store is not called after spawn it won\u0027t be\n        # available for the logger to pull from threadlocal storage.\n        if _context is not None:\n            _context.update_store()\n        if profiler_info and profiler:\n            profiler.init(**profiler_info)\n        return func(*args, **kwargs)\n    return runner(context_wrapper, *args, **kwargs)\n   return outer","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":false,"context_lines":[{"line_number":631,"context_line":"    return trace_info"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"def pass_context(runner, func, *args, **kwargs):"},{"line_number":635,"context_line":"    \"\"\"Generalised passthrough method"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    It will grab the context from the threadlocal store and add it to"}],"source_content_type":"text/x-python","patch_set":2,"id":"c100f807_6b3fc568","line":634,"range":{"start_line":634,"start_character":4,"end_line":634,"end_character":16},"in_reply_to":"03860435_345aef10","updated":"2022-03-01 15:36:49.000000000","message":"https://review.opendev.org/c/openstack/nova/+/827467/comment/5a66af00_d8dc8773/","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"c9254fc79ae89a427fa2ff958bf0c88119028cfa","unresolved":true,"context_lines":[{"line_number":655,"context_line":"    return runner(context_wrapper, *args, **kwargs)"},{"line_number":656,"context_line":""},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"def spawn(func, *args, **kwargs):"},{"line_number":659,"context_line":"    \"\"\"Passthrough method for eventlet.spawn."},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    This utility exists so that it can be stubbed for testing without"}],"source_content_type":"text/x-python","patch_set":2,"id":"33cdd165_5c63e4ae","line":658,"range":{"start_line":658,"start_character":0,"end_line":658,"end_character":33},"updated":"2022-02-22 11:24:02.000000000","message":"spawn \u003d functools.partail(eventlet.spawn, pass_context)","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":24434,"name":"Fabian Wiesel","email":"fabian.wiesel@sap.com","username":"fwiesel"},"change_message_id":"651752b4a752fe9d3ae7b17e97bd64530839ca7a","unresolved":false,"context_lines":[{"line_number":655,"context_line":"    return runner(context_wrapper, *args, **kwargs)"},{"line_number":656,"context_line":""},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"def spawn(func, *args, **kwargs):"},{"line_number":659,"context_line":"    \"\"\"Passthrough method for eventlet.spawn."},{"line_number":660,"context_line":""},{"line_number":661,"context_line":"    This utility exists so that it can be stubbed for testing without"}],"source_content_type":"text/x-python","patch_set":2,"id":"84b256a1_c3a0f376","line":658,"range":{"start_line":658,"start_character":0,"end_line":658,"end_character":33},"in_reply_to":"33cdd165_5c63e4ae","updated":"2022-03-01 15:36:49.000000000","message":"https://review.opendev.org/c/openstack/nova/+/827467/comment/5a66af00_d8dc8773/","commit_id":"860e8aa536c0d137519e588eaf573a0064ba4338"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d42630b61bbca91e279e4dc2d6123ea9b77f1943","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    return trace_info"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"def pass_context(runner, func, *args, **kwargs):"},{"line_number":635,"context_line":"    \"\"\"Generalised passthrough method"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    It will grab the context from the threadlocal store and add it to"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf6c2e1c_c2b56eac","line":634,"range":{"start_line":634,"start_character":4,"end_line":634,"end_character":16},"updated":"2022-03-23 14:42:05.000000000","message":"so i think this shoudl really have its own unit test to assert its behavior not that it has been split out.","commit_id":"a43b445f08a682451642860a7a893272c6dea8fb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"23eb90940c490386e152925902ece57681833fcd","unresolved":true,"context_lines":[{"line_number":631,"context_line":"    return trace_info"},{"line_number":632,"context_line":""},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"def pass_context(runner, func, *args, **kwargs):"},{"line_number":635,"context_line":"    \"\"\"Generalised passthrough method"},{"line_number":636,"context_line":""},{"line_number":637,"context_line":"    It will grab the context from the threadlocal store and add it to"}],"source_content_type":"text/x-python","patch_set":4,"id":"c73b9419_cbc3b8a1","line":634,"range":{"start_line":634,"start_character":4,"end_line":634,"end_character":16},"in_reply_to":"bf6c2e1c_c2b56eac","updated":"2022-08-04 10:45:19.000000000","message":"just to clarify I won\u0027t block on not having a unit test for this.\nI would be happy to proceed with this if its rebased with the merge conflicts fixed.","commit_id":"a43b445f08a682451642860a7a893272c6dea8fb"}]}
