)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"051b8cf1ccc396b64c5bdc143e5dba97e99a2bf9","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Sean Mooney \u003cwork@seanmooney.info\u003e"},{"line_number":5,"context_line":"CommitDate: 2024-05-02 11:57:36 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"use futureist for scater_gather"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change is the combination of 3 commits"},{"line_number":10,"context_line":"that must be comined due to how eventlet monkey patrching"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"e83a532d_aa30bd74","line":7,"range":{"start_line":7,"start_character":4,"end_line":7,"end_character":13},"updated":"2024-05-03 10:06:05.000000000","message":"`s/futureist/futurist/`\n\nHere and elsewere","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"051b8cf1ccc396b64c5bdc143e5dba97e99a2bf9","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Sean Mooney \u003cwork@seanmooney.info\u003e"},{"line_number":5,"context_line":"CommitDate: 2024-05-02 11:57:36 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"use futureist for scater_gather"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change is the combination of 3 commits"},{"line_number":10,"context_line":"that must be comined due to how eventlet monkey patrching"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"56ad8f83_c82c1308","line":7,"range":{"start_line":7,"start_character":18,"end_line":7,"end_character":31},"updated":"2024-05-03 10:06:05.000000000","message":"`s/scater_gather/scatter_gather/`\n\nbelow also.","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"051b8cf1ccc396b64c5bdc143e5dba97e99a2bf9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"6ef78cf3_21c488a5","updated":"2024-05-03 10:06:05.000000000","message":"Mostly comments","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"92b3ad2922c7331e313f40c734bd941e64696eeb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"f70555ee_55d4830b","updated":"2024-05-02 16:42:39.000000000","message":"recheck the nova-next timeout i think was unrelated to this patch.\nit pass on the follow up patches so lets confirm with a recheck","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"16888836_74c4db29","updated":"2024-08-26 15:00:29.000000000","message":"hard -1 on the timer code","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"}],"nova/compute/multi_cell_list.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"051b8cf1ccc396b64c5bdc143e5dba97e99a2bf9","unresolved":true,"context_lines":[{"line_number":106,"context_line":"        timer.start()"},{"line_number":107,"context_line":"    else:"},{"line_number":108,"context_line":"        timer \u003d eventlet.timeout.Timeout("},{"line_number":109,"context_line":"            context.CELL_TIMEOUT, exception.CellTimeout)"},{"line_number":110,"context_line":"    try:"},{"line_number":111,"context_line":"        for record in fn(ctx, *args, **kwargs):"},{"line_number":112,"context_line":"            yield record"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f00e435_81295095","line":109,"updated":"2024-05-03 10:06:05.000000000","message":"~~I suspect you\u0027re missing a `start` here, unless eventlet behaves auto-starts as part of `__init__`?~~\n\nAh, no, [it calls `start()`](https://github.com/eventlet/eventlet/blob/64d85164b6553499e53ce260ef096301c182ad04/eventlet/timeout.py#L55). Wonder if it\u0027s worth a comment here noting that this auto-starts?","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e4f7b5abf2c276c52a01ea1289f5c8eb4c47e547","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        timer.start()"},{"line_number":107,"context_line":"    else:"},{"line_number":108,"context_line":"        timer \u003d eventlet.timeout.Timeout("},{"line_number":109,"context_line":"            context.CELL_TIMEOUT, exception.CellTimeout)"},{"line_number":110,"context_line":"    try:"},{"line_number":111,"context_line":"        for record in fn(ctx, *args, **kwargs):"},{"line_number":112,"context_line":"            yield record"}],"source_content_type":"text/x-python","patch_set":3,"id":"a6ea77c8_fe61592b","line":109,"in_reply_to":"5f00e435_81295095","updated":"2024-08-16 13:30:06.000000000","message":"Done","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":true,"context_lines":[{"line_number":106,"context_line":"    # TODO(sean-k-mooney): i think we could just use threading"},{"line_number":107,"context_line":"    # even if we are monkey patched so revisit this later."},{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"}],"source_content_type":"text/x-python","patch_set":6,"id":"87c9c006_3fd85321","line":109,"updated":"2024-08-26 15:00:29.000000000","message":"at least if feels safer to be eventlet context aware as we call this from multiple services like scheduler, and we only removed eventlet from nova-api here.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"ea51fb75_6013c0cd","line":111,"updated":"2024-08-26 15:00:29.000000000","message":"Something feels missing here. The timeout function will be called in a separate thread created by the Timer object, so that will not stop the current thread even if it is raising an exception.  So this code will not stop the scatter gather run after the timeout passed.\n\n```\n❯ python3\nPython 3.12.5 (main, Aug 22 2024, 13:11:09) [GCC 14.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import threading\n\u003e\u003e\u003e import time\n\u003e\u003e\u003e def hello():\n...     while True:\n...             print(\"Hello\")\n...             time.sleep(1)\n... \n\u003e\u003e\u003e def timeout():\n...     raise ValueError()\n... \n\u003e\u003e\u003e threading.Timer(10, timeout).start()\n\u003e\u003e\u003e hello()\nHello\nHello\nHello\nHello\nHello\nHello\nHello\nHello\nException in thread Thread-1:\nTraceback (most recent call last):\n  File \"/usr/lib/python3.12/threading.py\", line 1075, in _bootstrap_inner\n    self.run()\n  File \"/usr/lib/python3.12/threading.py\", line 1433, in run\n    self.function(*self.args, **self.kwargs)\n  File \"\u003cstdin\u003e\", line 2, in timeout\nValueError\nHello\nHello\nHello\nHello\nHello\nHello\nHello\n^CTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"\u003cstdin\u003e\", line 4, in hello\nKeyboardInterrupt\n\u003e\u003e\u003e \n```","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"657b88fdaf9e6a12a93a695580af5a1a8df5efae","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"4e5202de_30367d29","line":111,"in_reply_to":"018f9e0b_b3d0e855","updated":"2024-08-27 07:48:32.000000000","message":"btw I\u0027m not sure how wsgi/httpd will work together with a process pool, but it feels scary to me.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"153ec0d71e3790990a5bcd175d94da21235aa488","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"5d0ed579_15453ba7","line":111,"in_reply_to":"4e5202de_30367d29","updated":"2024-08-27 11:39:06.000000000","message":"both thread pools and process pools escape the wsgiservers lifecycle management so its just as scarey either way we go.\n\n\nin this case we may be able to do the time out silgigly differntly.\n\nfor rbd we are using a blocking api with no timeout functionality\n\nhere we are interacting with the cell dbs directly and we may be able to inspect the funciontion and pass a timeout to sqlachemy?\n\nthis is only actuly used in one place to wrap do_query in get_records_sorted\n\nhttps://github.com/openstack/nova/blob/01b207e50d307a7e7650b5839535fbd3ad40bc1b/nova/compute/multi_cell_list.py#L262\n\nwe optionally pass a cell timeout \n\nhttps://github.com/openstack/nova/blob/01b207e50d307a7e7650b5839535fbd3ad40bc1b/nova/compute/multi_cell_list.py#L387-L393\n\nwe could just implement the time out in do_query or do it later here in  gather_result\n\nhttps://github.com/openstack/nova/blob/01b207e50d307a7e7650b5839535fbd3ad40bc1b/nova/context.py#L421  \n\n\nif we were to do it in do_query we would need to pass it to the db query and have sqlachemy handel it if possibel otherwise we can have it be run on the thread pool thread of we just move the timer to gather_result.\n\npersonly im leaning towards deleting query_wrapper and adding a timer in gather_result\n\nwhat do ye think about that approch?","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fbbf0a2cd08223c9a6c3c00f82066ce3131b1420","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"f0c14d75_21fff046","line":111,"in_reply_to":"5d0ed579_15453ba7","updated":"2024-08-27 20:10:07.000000000","message":"I\u0027m pretty sure sqlalchemy already has default timeouts.\n\nWith this whole \"cancel a thread\" effort, I think it was more about keeping parity with eventlet or not losing a bit of functionality we had with eventlet. I\u0027m not sure how likely or possible it will really be for a thread to become blocked forever here. I think we just ideally wanted control at this level (and not deeper into sqlalchemy etc) to be able to say \"I\u0027m not waiting any longer, I\u0027m moving on, and I will stop this thing from running\".\n\nI like both gibi\u0027s idea and the idea of adding a timer in gather_result. I don\u0027t know if it would be good to delete query_wrapper though, that\u0027s self-contained with the multi_cell_list and I think should be able to be used on its own, scatter-gather or not.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d15dc103fc036dc829bc9751dc70a90ebe158e65","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"bfee7062_041a166d","line":111,"in_reply_to":"a2c5a739_f81dd95e","updated":"2024-08-26 17:13:54.000000000","message":"This is expected. There was a lot of discussion at the time on my patch about the lack of parity between eventlet vs native threads with regard to cancelation. You can cancel an eventlet thread but you can\u0027t cancel a native thread. So the choices as I understood it were (as mentioned on IRC a moment ago):\n\n* Abandon the still running child thread after the timer expires\n* Use processes instead of threads and kill the child process after the timer expires\n* Somehow create a timer in the main thread and pass it to run in the child thread so when it expires it kills the child thread from within","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3c4197e9ce2b501391b5f3e36151d9cf76d6c9bd","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"018f9e0b_b3d0e855","line":111,"in_reply_to":"bfee7062_041a166d","updated":"2024-08-27 07:35:12.000000000","message":"If we need to cancel a thread then we need that such thread periodically check some synchronization primitive (a queue for tombstone, a threading.Event, etc) where the timer thread can signal cancellation.\n\nIn this particular case I guess we can assume that each gather thread will eventually finish and don\u0027t hang forever. So abandoning gather threads when the timer thread signals the main thread that time out happened sounds acceptable to me. However we need to make sure that such abandoned gather thread will eventually let the thread back to the threadpool without anybody consuming its result.\n\nThis would mean to change the timeout function to set a threading.Event, and let the main wait on booth the queue of reasults and the Event, whichever finishes first to continue processing the results. As far as I see the real waiting of results happens in queue.get() at https://github.com/openstack/nova/blob/01b207e50d307a7e7650b5839535fbd3ad40bc1b/nova/context.py#L439-L441 We can do that queue.get with a timeout to be able to periodically check the Event for cancellation.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"85ff9fff2cbcd86317ae48ce9c6f755ed5981cf4","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"a2c5a739_f81dd95e","line":111,"in_reply_to":"ea51fb75_6013c0cd","updated":"2024-08-26 16:38:46.000000000","message":"ill review this but this is not actully my code\n\nthis was orginaly melainiens to im just porting her patch into the series\nso ill need to dig into this\n\nthe orgininal is here \nhttps://review.opendev.org/c/openstack/nova/+/650172/28/nova/compute/multi_cell_list.py#101\n\ni was expecting the timer to be started on teh main thread and the funtion to be executed on the thread pool so when the timeer expired i was expecting the main thread to proceed via the except exception.CellTimeout:\n\nbut for the trhead to still be runnignin the thread pool.\n\nwe cannot safely cancel theread as they may hold a lock, so unless we use a proces  pool i dont know of a safe way to chanel the treads on thread pool unless we have a second time that is created on the worker thread?\n\nim not sure how to do that however.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"57eee9f03fcc7f3312109df899e3bcb1e07b355b","unresolved":true,"context_lines":[{"line_number":108,"context_line":"    # eventually when we remove eventlet entirely we can remove"},{"line_number":109,"context_line":"    # this if and just use threading in any event."},{"line_number":110,"context_line":"    if not monkey_patch.is_patched():"},{"line_number":111,"context_line":"        timer \u003d threading.Timer(context.CELL_TIMEOUT, timed_out)"},{"line_number":112,"context_line":"        timer.start()"},{"line_number":113,"context_line":"    else:"},{"line_number":114,"context_line":"        # NOTE(sean-k-mooney): eventlet calls start internally"}],"source_content_type":"text/x-python","patch_set":6,"id":"39aa684b_e1744b35","line":111,"in_reply_to":"f0c14d75_21fff046","updated":"2024-08-27 20:17:11.000000000","message":"\u003e I don\u0027t know if it would be good to delete query_wrapper though, that\u0027s self-contained with the multi_cell_list and I think should be able to be used on its own, scatter-gather or not.\n\nAlthough, I guess the entire purpose of the query_wrapper is for scatter-gather, so nevermind this part.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"85ff9fff2cbcd86317ae48ce9c6f755ed5981cf4","unresolved":true,"context_lines":[{"line_number":116,"context_line":"        timer \u003d eventlet.timeout.Timeout("},{"line_number":117,"context_line":"            context.CELL_TIMEOUT, exception.CellTimeout)"},{"line_number":118,"context_line":"    try:"},{"line_number":119,"context_line":"        for record in fn(ctx, *args, **kwargs):"},{"line_number":120,"context_line":"            yield record"},{"line_number":121,"context_line":"    except exception.CellTimeout:"},{"line_number":122,"context_line":"        # Here, we yield a RecordWrapper (no sort_ctx needed since"}],"source_content_type":"text/x-python","patch_set":6,"id":"d3493d60_25b9ee17","line":119,"range":{"start_line":119,"start_character":22,"end_line":119,"end_character":24},"updated":"2024-08-26 16:38:46.000000000","message":"so im expecting fn to internally call running on the threadpool\n\nthat might not be a vaild assumption but the existing code was not calling eventlet.swapn so the existing coudl would not be concurrent if fn was not.\n\nif that is as i expect i don\u0027t think your example is really the same as we do not run the blocking function on the main thread. that said if its not doing that then yes that would be a problem.\n\n\nill need to check the timer api to see if there is an alternitive usage patteren that we should be following \n\nmelaine did express some concerns with this code i guess in \nhttps://review.opendev.org/c/openstack/nova/+/650172/comments/2889d690_cedf0c8d\nso maybe instead of proting her version i should consider writing this form scratch again.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"}],"nova/conductor/manager.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"051b8cf1ccc396b64c5bdc143e5dba97e99a2bf9","unresolved":true,"context_lines":[{"line_number":2077,"context_line":"        if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":2078,"context_line":"            fetch_pool \u003d futurist.ThreadPoolExecutor(max_workers\u003dthreads)"},{"line_number":2079,"context_line":"        else:"},{"line_number":2080,"context_line":"            fetch_pool \u003d futurist.GreenThreadPoolExecutor()"},{"line_number":2081,"context_line":""},{"line_number":2082,"context_line":"        hosts_by_cell \u003d {}"},{"line_number":2083,"context_line":"        cells_by_uuid \u003d {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffec0f98_3ac2cf50","line":2080,"updated":"2024-05-03 10:06:05.000000000","message":"This takes a `max_workers` argument also. Any reason not to pass one? We could do with a comment if it\u0027s intended.","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e4f7b5abf2c276c52a01ea1289f5c8eb4c47e547","unresolved":false,"context_lines":[{"line_number":2077,"context_line":"        if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":2078,"context_line":"            fetch_pool \u003d futurist.ThreadPoolExecutor(max_workers\u003dthreads)"},{"line_number":2079,"context_line":"        else:"},{"line_number":2080,"context_line":"            fetch_pool \u003d futurist.GreenThreadPoolExecutor()"},{"line_number":2081,"context_line":""},{"line_number":2082,"context_line":"        hosts_by_cell \u003d {}"},{"line_number":2083,"context_line":"        cells_by_uuid \u003d {}"}],"source_content_type":"text/x-python","patch_set":3,"id":"cc42588a_741fa181","line":2080,"in_reply_to":"ffec0f98_3ac2cf50","updated":"2024-08-16 13:30:06.000000000","message":"this has been centralised into a separate commit \nbut for green thread, we are not really as worried about that.\nthey use much less memory and we were not previously limiting it so i didn\u0027t see the need originally to do it since the goal is to remove all eventlet usage anyway.","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":true,"context_lines":[{"line_number":22,"context_line":"import typing as ty"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import futurist.waiters"},{"line_number":25,"context_line":"import oslo_messaging as messaging"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"from keystoneauth1 import exceptions as ks_exc"},{"line_number":28,"context_line":"from oslo_config import cfg"}],"source_content_type":"text/x-python","patch_set":6,"id":"403813f3_422fe8ef","line":25,"updated":"2024-08-26 15:00:29.000000000","message":"we this import is moved?","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"}],"nova/context.py":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"e32d20b2ee122da85e018d663fa094302752a942","unresolved":true,"context_lines":[{"line_number":60,"context_line":"def executor_singleton():"},{"line_number":61,"context_line":"    global EXECUTOR"},{"line_number":62,"context_line":"    if EXECUTOR is None:"},{"line_number":63,"context_line":"        if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":64,"context_line":"            EXECUTOR \u003d futurist.ThreadPoolExecutor("},{"line_number":65,"context_line":"                max_workers\u003dCONF.osapi_compute_workers)"},{"line_number":66,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"52381e77_00f4f97c","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":57},"updated":"2024-05-16 13:17:48.000000000","message":"Same remark that with my previous comment","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e4f7b5abf2c276c52a01ea1289f5c8eb4c47e547","unresolved":false,"context_lines":[{"line_number":60,"context_line":"def executor_singleton():"},{"line_number":61,"context_line":"    global EXECUTOR"},{"line_number":62,"context_line":"    if EXECUTOR is None:"},{"line_number":63,"context_line":"        if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":64,"context_line":"            EXECUTOR \u003d futurist.ThreadPoolExecutor("},{"line_number":65,"context_line":"                max_workers\u003dCONF.osapi_compute_workers)"},{"line_number":66,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"4ae214c4_ae71c5fb","line":63,"range":{"start_line":63,"start_character":8,"end_line":63,"end_character":57},"in_reply_to":"52381e77_00f4f97c","updated":"2024-08-16 13:30:06.000000000","message":"Acknowledged","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"05eb13b3e618ebb369559a80c325197369781b88","unresolved":true,"context_lines":[{"line_number":468,"context_line":"    done_futures \u003d []"},{"line_number":469,"context_line":"    for cell_uuid, future in threads:"},{"line_number":470,"context_line":"        if cell_uuid not in results:"},{"line_number":471,"context_line":"            # NOTE(melwitt): Running futures cannot be canceled, so this will"},{"line_number":472,"context_line":"            # return False in most cases, but we will try it anyway."},{"line_number":473,"context_line":"            # The futurist.ThreadPoolExecutor runs threads with daemon\u003dTrue, so"},{"line_number":474,"context_line":"            # they will not block a shutdown and can be left to exit on their"}],"source_content_type":"text/x-python","patch_set":3,"id":"f4895082_53cbeca5","line":471,"range":{"start_line":471,"start_character":19,"end_line":471,"end_character":26},"updated":"2024-05-16 13:22:51.000000000","message":"Accounting the complete rewording of this comment, I\u0027d suggest to now assign this comment to you (Sean).","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e4f7b5abf2c276c52a01ea1289f5c8eb4c47e547","unresolved":true,"context_lines":[{"line_number":468,"context_line":"    done_futures \u003d []"},{"line_number":469,"context_line":"    for cell_uuid, future in threads:"},{"line_number":470,"context_line":"        if cell_uuid not in results:"},{"line_number":471,"context_line":"            # NOTE(melwitt): Running futures cannot be canceled, so this will"},{"line_number":472,"context_line":"            # return False in most cases, but we will try it anyway."},{"line_number":473,"context_line":"            # The futurist.ThreadPoolExecutor runs threads with daemon\u003dTrue, so"},{"line_number":474,"context_line":"            # they will not block a shutdown and can be left to exit on their"}],"source_content_type":"text/x-python","patch_set":3,"id":"458cf815_e1e07f2b","line":471,"range":{"start_line":471,"start_character":19,"end_line":471,"end_character":26},"in_reply_to":"f4895082_53cbeca5","updated":"2024-08-16 13:30:06.000000000","message":"as noted in the commit message, as part of this im porting a commit melwitt wrote\n\nso this comment is directly from that \nhttps://review.opendev.org/c/openstack/nova/+/650172/28/nova/context.py#469\n\nthe content is the same so i kept her as the author","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"05eb13b3e618ebb369559a80c325197369781b88","unresolved":true,"context_lines":[{"line_number":471,"context_line":"            # NOTE(melwitt): Running futures cannot be canceled, so this will"},{"line_number":472,"context_line":"            # return False in most cases, but we will try it anyway."},{"line_number":473,"context_line":"            # The futurist.ThreadPoolExecutor runs threads with daemon\u003dTrue, so"},{"line_number":474,"context_line":"            # they will not block a shutdown and can be left to exit on their"},{"line_number":475,"context_line":"            # own while we are running."},{"line_number":476,"context_line":"            future.cancel()"},{"line_number":477,"context_line":"            results[cell_uuid] \u003d did_not_respond_sentinel"},{"line_number":478,"context_line":"            LOG.warning(f\u0027Timed out after waiting {timeout} seconds for \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"32fa4a40_9708e1bd","line":475,"range":{"start_line":474,"start_character":45,"end_line":475,"end_character":39},"updated":"2024-05-16 13:22:51.000000000","message":"What if they are stucks in their execution?\nDo we have way to monitor and clean up them?","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e4f7b5abf2c276c52a01ea1289f5c8eb4c47e547","unresolved":true,"context_lines":[{"line_number":471,"context_line":"            # NOTE(melwitt): Running futures cannot be canceled, so this will"},{"line_number":472,"context_line":"            # return False in most cases, but we will try it anyway."},{"line_number":473,"context_line":"            # The futurist.ThreadPoolExecutor runs threads with daemon\u003dTrue, so"},{"line_number":474,"context_line":"            # they will not block a shutdown and can be left to exit on their"},{"line_number":475,"context_line":"            # own while we are running."},{"line_number":476,"context_line":"            future.cancel()"},{"line_number":477,"context_line":"            results[cell_uuid] \u003d did_not_respond_sentinel"},{"line_number":478,"context_line":"            LOG.warning(f\u0027Timed out after waiting {timeout} seconds for \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"b579f58d_f4fae6d7","line":475,"range":{"start_line":474,"start_character":45,"end_line":475,"end_character":39},"in_reply_to":"32fa4a40_9708e1bd","updated":"2024-08-16 13:30:06.000000000","message":"no not really\n\nthe only alternitive we woudl have to allow cancelation woudl be to use a process pool. we may consider that in the future but for now this is not really diffent then what we have in thet case of eventlet today.","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":true,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from contextlib import contextmanager"},{"line_number":21,"context_line":"import copy"},{"line_number":22,"context_line":"import queue as queue_mod"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import futurist.waiters"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"72fd65ec_83410253","line":22,"updated":"2024-08-26 15:00:29.000000000","message":"nit: stdlib_queue (used in the test code) feels a bit better name.","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fbbf0a2cd08223c9a6c3c00f82066ce3131b1420","unresolved":true,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from contextlib import contextmanager"},{"line_number":21,"context_line":"import copy"},{"line_number":22,"context_line":"import queue as queue_mod"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"import futurist.waiters"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"a17e4f69_c4e8ab92","line":22,"in_reply_to":"72fd65ec_83410253","updated":"2024-08-27 20:10:07.000000000","message":"Agree","commit_id":"d1b7bc2b56afe0566867e4aa8729181993d4a801"}],"nova/rpc.py":[{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"885ca5af545baf88afc1f9064920360a0d4a36a6","unresolved":true,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"c6dd22a2_70eeabf9","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"updated":"2024-05-16 13:14:22.000000000","message":"I\u0027d suggest to be more prudent with that kind of test.\nIndeed, depending on context, and several time, Eventlet internaly disable the monkey patching of the Threading module.\n\nSo, in some circumstance this condition may be false, even if significant part of the stdlib are still monkey patched by Eventlet, leading you to mixin patched and non-patched things, that you may think unpatched...\n\nBy example, some hubs explicitly disabled this module (threading) monkey patching due to blocking dns calls or things like that...\n\n- https://github.com/eventlet/eventlet/blob/ec6c0fffccc129bea468a5badb03034d83f8cc5e/eventlet/green/profile.py#L45\n- https://github.com/eventlet/eventlet/blob/ec6c0fffccc129bea468a5badb03034d83f8cc5e/eventlet/hubs/__init__.py#L12\n- https://github.com/eventlet/eventlet/blob/ec6c0fffccc129bea468a5badb03034d83f8cc5e/eventlet/hubs/asyncio.py#L17\n\nSo if at some point you switch from a hub to another, this condition won\u0027t be relevant anymore.\n\nHence, the question, is more to know if that condtion try to test if Eventlet is up, or only if you are really interested only by the threading module.\n\nIf you simply want to know if Eventlet is up, then, I\u0027d suggest to test if more modules than the threading one are monkey patched.\n\nIf you only care about the threading module, you should notice that potentially other stdlib modules are still monkey patched, and so, possibly, not anymore compatible with the unpatched threading module, but it is hard to predict where it may broke in this circumstance.","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"070e91cf21cbc9f59495172f95cac7296c4500f8","unresolved":true,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ff00fbff_7a1b1f13","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"in_reply_to":"3e37027b_023c645c","updated":"2024-05-17 11:00:44.000000000","message":"No problem, I understand.\nLet me know if I can help you.\nThanks for your personal commitment, much appreciated!","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":28522,"name":"Hervé Beraud","email":"herveberaud.pro@gmail.com","username":"hberaud"},"change_message_id":"fa24b14c1e427ee9b0b9b5d27cad12a5705d8654","unresolved":true,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9dc90054_9a76ff17","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"in_reply_to":"4cc50a7a_279de835","updated":"2024-05-17 09:45:27.000000000","message":"The `eventletutis.is_monkey_patched` is just a wrapper over `eventlet.patcher.is_monkey_patched`, using this wrapper is not a problem.\n\nI don\u0027t think your code is a problem.\n\nMy point is more to highlight a possible non expected behavior in some circumstance, to take its usage carefully and its result as a unsacred truth.\n\n```\nimport eventlet\neventlet.monkey_patch()\n\nimport threading\nimport os\nimport _thread\n\nprint(\u0027before thread: \u0027, eventlet.patcher.is_monkey_patched(\"thread\"))\nprint(\u0027before threading: \u0027, eventlet.patcher.is_monkey_patched(\"threading\"))\nprint(\u0027before os: \u0027, eventlet.patcher.is_monkey_patched(\"os\"))\n\nthreading \u003d eventlet.patcher.original(\"threading\")\nos \u003d eventlet.patcher.original(\"os\")\n_thread \u003d eventlet.patcher.original(\"_thread\")\n\nprint(\u0027after thread: \u0027, eventlet.patcher.is_monkey_patched(\"thread\"))\nprint(\u0027after threading: \u0027, eventlet.patcher.is_monkey_patched(\"threading\"))\nprint(\u0027after os: \u0027, eventlet.patcher.is_monkey_patched(\"os\"))\n```\n\nWould exit:\n\n```\nbefore thread:  True\nbefore threading:  False\nbefore os:  True\nafter thread:  True\nafter threading:  False\nafter os:  True\n```\n\nThe state of the restored modules may differ from the state internally stored in eventlet. So if a module is restored at an execution point, and if a test about this module state is made later in an other execution point, the results may diverge and this module may be seen as non-restored even if it is...\n\nAnd the case of the threading module not really clear to me... It is but it isn\u0027t...:\n- https://github.com/eventlet/eventlet/blob/master/eventlet/patcher.py#L249\n- https://github.com/eventlet/eventlet/blob/master/eventlet/green/thread.py\n- https://github.com/eventlet/eventlet/blob/master/eventlet/green/threading.py","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"a528687ecb2d9480f0112329a9af9ad3e99b3187","unresolved":true,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"4cc50a7a_279de835","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"in_reply_to":"4db07237_a54e9065","updated":"2024-05-16 14:22:47.000000000","message":"by the way im aware that internally eventlet can use the unpatched moduels in some cases and in very limited case nova even does that where we expcitly need too.\n\nbut i woudl consider it a critical bug in evently if we do \n\n eventlet.monkey_patch()\n and then \n \n https://eventlet.readthedocs.io/en/latest/patching.html#eventlet.patcher.is_monkey_patched\n \nreturned inconsistent results without nova explicitly deactivating the patching.\n\nonce we monkey patch nova never deactivates the monkey patching even if we somethime get the un pathc modules and use them very carfully for specific things like talkign to libvirt with a native thread..","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"7182fdd85c50cc74274f15dcf7523d17f559f2ca","unresolved":true,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3e37027b_023c645c","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"in_reply_to":"9dc90054_9a76ff17","updated":"2024-05-17 10:29:35.000000000","message":"ok I dont think this is a problem\nthe pattern you are describing does not happen in nova.\nif we ever import the orginal module its alwasy under a diffent name then the module name.\n\nwith that said i have been putting off a slightly larger refactor that i might do instead to make this more robust.\ni wont get back to this until next wekk but ill look at doing that refactor next week.\n\nnote that im trying to be tactical with my time on this since this is being driven form my personal innovation/learing time so i cant spend more then 5-10% of my time to work on this. im trying not to do work that is not strictly needed to achieve the aim of removing eventlet.","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"071c235ab72c96d121d605463981b8b5b6d11323","unresolved":true,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"4db07237_a54e9065","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"in_reply_to":"c6dd22a2_70eeabf9","updated":"2024-05-16 14:10:17.000000000","message":"well in this specfici case we are using it to choose the executor to use\n\nform a nova point of either we are mokeypatching early and using eventlet or nothing within the process will use eventlet in any capastity.\n\nwe are not going to supprot multipel hubs or switch hubs at runtime or other complex configuration.\n\nnova does the following to monkey patch\n\n    if debugger.enabled():\n        # turn off thread patching to enable the remote debugger\n        eventlet.monkey_patch(thread\u003dFalse)\n    elif os.name \u003d\u003d \u0027nt\u0027:\n        # for nova-compute running on Windows(Hyper-v)\n        # pipes don\u0027t support non-blocking I/O\n        eventlet.monkey_patch(os\u003dFalse)\n    else:\n        eventlet.monkey_patch()\n        \n        \nwe do not support Windows anymore and honestly, the debug flag is not used eitehr because it does not work properly so we effectivly call\n\neventlet.monkey_patch() when we monkey patch.  \n\nis there a better way to tell if that has been called.\n\ni am considering reworkign how we monkey patch too but i was using the \n\n eventletutils.is_monkey_patched(\u0027thread\u0027): because that is the convention we have used for years.\n \n im basiclly considing just setting a module-level flag to say if we are monkeypatched or not and checking that","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e4f7b5abf2c276c52a01ea1289f5c8eb4c47e547","unresolved":false,"context_lines":[{"line_number":214,"context_line":"    assert TRANSPORT is not None"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7e4f5849_6d2fdc23","line":217,"range":{"start_line":217,"start_character":4,"end_line":217,"end_character":53},"in_reply_to":"ff00fbff_7a1b1f13","updated":"2024-08-16 13:30:06.000000000","message":"Acknowledged","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"051b8cf1ccc396b64c5bdc143e5dba97e99a2bf9","unresolved":true,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"},{"line_number":221,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ad2636cb_5de23b00","line":218,"updated":"2024-05-03 10:06:05.000000000","message":"Is it worth a debug log here if we\u0027re planning on driving out eventlet entirely?","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":false,"context_lines":[{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    executor \u003d \u0027eventlet\u0027"},{"line_number":217,"context_line":"    if not eventletutils.is_monkey_patched(\u0027thread\u0027):"},{"line_number":218,"context_line":"        executor \u003d \u0027threading\u0027"},{"line_number":219,"context_line":"    if profiler:"},{"line_number":220,"context_line":"        serializer \u003d ProfilerRequestContextSerializer(serializer)"},{"line_number":221,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5636d26f_48774c53","line":218,"in_reply_to":"ad2636cb_5de23b00","updated":"2024-08-26 15:00:29.000000000","message":"Done","commit_id":"554892bc72c6a3b93c9a8a905e89107e94ca46de"}],"nova/tests/unit/test_context.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"5dbfedb83734d8ad24b23205e100d60b069cfdce","unresolved":true,"context_lines":[{"line_number":345,"context_line":"    @mock.patch(\u0027nova.context.target_cell\u0027)"},{"line_number":346,"context_line":"    @mock.patch(\u0027nova.objects.InstanceList.get_by_filters\u0027)"},{"line_number":347,"context_line":"    def test_scatter_gather_cells(self, mock_get_inst, mock_target_cell):"},{"line_number":348,"context_line":"        self.useFixture(nova_fixtures.SpawnIsSynchronousFixture())"},{"line_number":349,"context_line":"        ctxt \u003d context.get_context()"},{"line_number":350,"context_line":"        mapping \u003d objects.CellMapping(database_connection\u003d\u0027fake://db\u0027,"},{"line_number":351,"context_line":"                                      transport_url\u003d\u0027fake://mq\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"168a841f_d1793cfd","side":"PARENT","line":348,"updated":"2024-08-26 15:00:29.000000000","message":"do we need         self.useFixture(nova_fixtures.SynchronousThreadPoolExecutorFixture() here instead?","commit_id":"c2b058a76462de1833cbe49f8e8b23469c78f8c2"}]}
