)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":true,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As part of the Eventlet removal, this patch replaces eventlet.event.Event"},{"line_number":10,"context_line":"with the equivalent threading.Event"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I469ca9592a5c6d1f7ea1f54e4d34546224ce7ada"},{"line_number":13,"context_line":"Signed-off-by: Kamil Sambor \u003ckamil.sambor@gmail.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"edf6660b_c18ddbd4","line":11,"updated":"2025-07-04 13:29:10.000000000","message":"A summary of the mapping between the two interface would be nice here. I.e. send \u003d\u003e set, ready \u003d\u003e is_set, etc.\n\nAlso a sentence of two about why we need the new ThreadingEventWithResult construct.","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fc5471b9ab2af58871ead83bfae670dc09c01a26","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"As part of the Eventlet removal, this patch replaces eventlet.event.Event"},{"line_number":10,"context_line":"with the equivalent threading.Event"},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I469ca9592a5c6d1f7ea1f54e4d34546224ce7ada"},{"line_number":13,"context_line":"Signed-off-by: Kamil Sambor \u003ckamil.sambor@gmail.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7e070dfd_e0d0f14b","line":11,"in_reply_to":"edf6660b_c18ddbd4","updated":"2025-07-07 14:44:08.000000000","message":"Done","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"210f5ce5_7008f57a","updated":"2025-05-22 14:57:48.000000000","message":"Sorry I have full set of answers but I have at least some suggestions.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fbb4c503015d3484894ac55cd1a1de9f92ff542d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"01784c62_669998e2","updated":"2025-06-23 10:51:23.000000000","message":"recheck","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8113ad54bc479847133838ee7f4c4d7d7b54648a","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"ac195cce_2ade92b1","in_reply_to":"01784c62_669998e2","updated":"2025-06-23 10:52:29.000000000","message":"could you put this on the eventlet-removal topic?","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"ad2fc05d12938d22b72608bf1789e1ee4758753e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"91540d82_e43b5cfe","in_reply_to":"ac195cce_2ade92b1","updated":"2025-06-25 14:28:31.000000000","message":"Done","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a59fd85a250f5934ca93b32731fae8b14dcba3bd","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":5,"id":"349dcc89_d592ebe6","in_reply_to":"ac195cce_2ade92b1","updated":"2025-06-23 11:48:33.000000000","message":"I guess you need to rebase as zuul is not triggering on it as it is outdated.","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"6e161029_f833d4e8","updated":"2025-07-04 13:29:10.000000000","message":"The impl looks good but the test changes suggest a bug around the timeout case.","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8fb93799c79b250a3113b012797849ad324ec72d","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":17,"id":"c360fe6b_bf35e59e","updated":"2025-07-08 13:19:04.000000000","message":"+1  over all, i need to review the followup changes but im not convinced that ThreadingEventWithResult is logically correct.\nas noted inline i think what we actully want is a future.","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fb2551ff462f65fbb31c37630eafb8a4fa30a698","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"33ecff9f_ac524c76","updated":"2025-07-09 09:52:40.000000000","message":"Thanks for reviews @gibizer@gmail.com @smooney@redhat.com","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2b4631f55c352e45e33be6f8631c38c6919b253c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"a0239d24_739f7fa4","updated":"2025-07-21 06:54:48.000000000","message":"+1 race condition :)","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"edbb852fcb478d708851e4ff7a24a1a315ce927f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"09eb5928_da616629","updated":"2025-07-18 13:37:52.000000000","message":"recheck nova-ceph-multistore seems to be libvirt is broken. Lets see if this was a one off.\n```\n2025-07-17 14:49:45.990103 | controller | + functions:wait_for_compute:505           :   echo \u0027Didn\u0027\\\u0027\u0027t find service registered by hostname after 60 seconds\u0027\n2025-07-17 14:49:45.990167 | controller | Didn\u0027t find service registered by hostname after 60 seconds\n```\n\n```\nJul 17 14:48:09.907599 npea2e3c26edad4 nova-compute[96711]: ERROR nova.virt.libvirt.host   File \"/usr/lib/python3/dist-packages/libvirt.py\", line 147, in openAuth\n990\tJul 17 14:48:09.907599 npea2e3c26edad4 nova-compute[96711]: ERROR nova.virt.libvirt.host     raise libvirtError(\u0027virConnectOpenAuth() failed\u0027)\n991\tJul 17 14:48:09.907599 npea2e3c26edad4 nova-compute[96711]: ERROR nova.virt.libvirt.host libvirt.libvirtError: Cannot recv data: Connection reset by peer\n992\tJul 17 14:48:09.907599 npea2e3c26edad4 nova-compute[96711]: ERROR nova.virt.libvirt.host \n993\tJul 17 14:48:09.953991 npea2e3c26edad4 nova-compute[96711]: ERROR oslo_service.backend.eventlet.service [None req-f68f9bc3-4d4b-4cae-95e8-1d069aac3e0f None None] Error starting thread.: nova.exception.HypervisorUnavailable: Connection to the hypervisor is broken on host\n```","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f0ea835ff171e377415ddb4c9fd29cd8897e6096","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"aba8b6b2_d5a0d3b6","updated":"2025-07-18 13:59:50.000000000","message":"the remaining time tracking logic looks good","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"6f021fa0_72c7b981","updated":"2025-07-22 15:28:24.000000000","message":"Thanks the new event impl looks good to me now from thread safety perspective.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55307bbda786828cc9ada32a4a79624556ba62f6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"853c6857_d7f5224e","updated":"2025-07-24 14:26:48.000000000","message":"I haven\u0027t finished reviewing this, but I have a question about how we\u0027re ending up with the compute manager\u0027s internal behavior bubbling back into the virt drivers. There must be some path, which I\u0027ll go look for, but perhaps you can enlighten me faster.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":22,"id":"f41bd1d5_b28de6f2","updated":"2025-07-25 08:44:41.000000000","message":"Thanks for reviews!","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a7113eca1275e54868252c6ee09a23fe5c49d212","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":24,"id":"926bf262_90b3e177","updated":"2025-07-29 12:31:00.000000000","message":"I think we only have a missing test case and a small formatting issue but otherwise this is ready to land","commit_id":"92c027762d6e87cdfb8ab64a7bc6b0ed6fb341d5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8e723bddfc49b05aa5f1a5bf3d0a9880bbcbc592","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":25,"id":"1dcf6d47_6362ea9b","updated":"2025-07-29 14:31:09.000000000","message":"This looks good to me now","commit_id":"48ddc7c4d13028a0ebcbabfa75a19828129d0d0b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e0cd1a9114a3a2772175c360709ebee4b10d0c3d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":25,"id":"108b4012_db8ab54a","updated":"2025-07-29 16:06:06.000000000","message":"recheck looks unrelated messaging timeout, among other things\n\nCoverage looks good now, test fails unrelated.","commit_id":"48ddc7c4d13028a0ebcbabfa75a19828129d0d0b"}],"nova/compute/manager.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3b709e0c3c28b0b877b73ee24618229b75a6c9aa","unresolved":true,"context_lines":[{"line_number":430,"context_line":"            self.status \u003d self.WAITING"},{"line_number":431,"context_line":"            try:"},{"line_number":432,"context_line":"                with timeutils.StopWatch() as sw:"},{"line_number":433,"context_line":"                    instance_event \u003d self.event.wait()"},{"line_number":434,"context_line":"            except eventlet.timeout.Timeout:"},{"line_number":435,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":436,"context_line":"                self.wait_time \u003d sw.elapsed()"}],"source_content_type":"text/x-python","patch_set":2,"id":"a7cb26f6_ffa0b5ad","line":433,"updated":"2025-05-15 15:06:16.000000000","message":"in threading we need a queue to be able to recieve a bit of information from the other thread that used the send() call. \n\n* send will be queue.put()\n* wait() will queue.get()\n* is_ready() will be someting on the queue :)\n\n---\n\nqueue.get(timeout\u003dtimeout) blocking until timeout and then raises an Empty exception. So late we can use this to remove the eventlet.timeout handling by useing the same queue.","commit_id":"954aa67016cd87c7a2ebcca7013202c1aa545495"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"220a09d158eae4c25108503b3a5fc1b2b2060782","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            self.status \u003d self.WAITING"},{"line_number":431,"context_line":"            try:"},{"line_number":432,"context_line":"                with timeutils.StopWatch() as sw:"},{"line_number":433,"context_line":"                    instance_event \u003d self.event.wait()"},{"line_number":434,"context_line":"            except eventlet.timeout.Timeout:"},{"line_number":435,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":436,"context_line":"                self.wait_time \u003d sw.elapsed()"}],"source_content_type":"text/x-python","patch_set":2,"id":"012e840b_ec8f7feb","line":433,"in_reply_to":"a7cb26f6_ffa0b5ad","updated":"2025-06-27 08:25:09.000000000","message":"we changed direction","commit_id":"954aa67016cd87c7a2ebcca7013202c1aa545495"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":240,"context_line":"    return decorated_function"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"class EventletLikeEvent(threading.Event):"},{"line_number":244,"context_line":"    def __init__(self):"},{"line_number":245,"context_line":"        super().__init__()"},{"line_number":246,"context_line":"        # event_queue is a queue.Queue with maxsize 1 for event passing"}],"source_content_type":"text/x-python","patch_set":3,"id":"4343d8ad_2da34ec7","line":243,"range":{"start_line":243,"start_character":6,"end_line":243,"end_character":23},"updated":"2025-05-22 14:57:48.000000000","message":"I know that that is our goal. But I would define this class for the longer future where we want to be disconnected form the fact that once we used eventlet. So lets define the expected behavior of this construct in a way that it is understandable without knowing how eventlet behaved.\n\nNaming is hard. Event is too generic without a module name like \"threading\". Lets get back to the naming after we have the behavior pinned down.\n\nWe want to pass one piece of information between threads. Actually threading.Event is capable of synchronizing between more than two threads:\n\n```\n\u003e\u003e\u003e import threading\n\u003e\u003e\u003e event \u003d threading.Event()\n\u003e\u003e\u003e from concurrent import futures\n\u003e\u003e\u003e executor \u003d futures.ThreadPoolExecutor()\n\u003e\u003e\u003e def waiter():\n...     event.wait()\n...     print(\"event happend\")\n...     \n\u003e\u003e\u003e executor.submit(waiter)\n\u003cFuture at 0x7fb50f3b0c20 state\u003drunning\u003e\n\u003e\u003e\u003e executor.submit(waiter)\n\u003cFuture at 0x7fb50f3787d0 state\u003drunning\u003e\n\u003e\u003e\u003e executor.submit(waiter)\n\u003cFuture at 0x7fb50f379d10 state\u003drunning\u003e\n\u003e\u003e\u003e event.set()\nevent happend\n             \u003e\u003e\u003e event happend\n                              event happend\n\n\u003e\u003e\u003e \n```\nBut our construct here cannot pass the same piece of information to multiple threads as the first thread will consume the information from the queue and then later threads will wait.\n\n\nThe eventlet.Event construct was able to send the same message to N threads:\n```\n❯ python3\nPython 3.12.10 (main, Apr  9 2025, 04:44:59) [GCC 14.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import eventlet\n\u003e\u003e\u003e eventlet.monkey_patch()\n\u003e\u003e\u003e event \u003d eventlet.Event()\n\u003e\u003e\u003e from eventlet import greenpool\n\u003e\u003e\u003e pool \u003d greenpool.GreenPool()\n\u003e\u003e\u003e def waiter():\n...     result \u003d event.wait()\n...     print(\"event happened\", result)\n... \n\u003e\u003e\u003e pool.spawn(waiter)\n\u003cGreenThread object at 0x7fa4af775c00 (otid\u003d0x(nil)) pending\u003e\n\u003e\u003e\u003e pool.spawn(waiter)\n\u003cGreenThread object at 0x7fa4af775e00 (otid\u003d0x(nil)) pending\u003e\n\u003e\u003e\u003e pool.spawn(waiter)\n\u003cGreenThread object at 0x7fa4af775f80 (otid\u003d0x(nil)) pending\u003e\n\u003e\u003e\u003e \n\u003e\u003e\u003e event.send(\"foo\")\n\u003e\u003e\u003e import time\n\u003e\u003e\u003e time.sleep(0)\nevent happened foo\nevent happened foo\nevent happened foo\n\u003e\u003e\u003e \n```\n\nNow it is good question if our usage of the eventlet.Event ever relied on passing a  piece of information to more than one thread. If yes then we need a smarter alternative than a single queue. If no then we can keep the queue and simply document that our new construct is simply passing data between two threads and no more.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"ad2fc05d12938d22b72608bf1789e1ee4758753e","unresolved":false,"context_lines":[{"line_number":240,"context_line":"    return decorated_function"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"class EventletLikeEvent(threading.Event):"},{"line_number":244,"context_line":"    def __init__(self):"},{"line_number":245,"context_line":"        super().__init__()"},{"line_number":246,"context_line":"        # event_queue is a queue.Queue with maxsize 1 for event passing"}],"source_content_type":"text/x-python","patch_set":3,"id":"39cc8cc1_3066f834","line":243,"range":{"start_line":243,"start_character":6,"end_line":243,"end_character":23},"in_reply_to":"4343d8ad_2da34ec7","updated":"2025-06-25 14:28:31.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":246,"context_line":"        # event_queue is a queue.Queue with maxsize 1 for event passing"},{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"}],"source_content_type":"text/x-python","patch_set":3,"id":"4db6205e_3f32db18","line":249,"updated":"2025-05-22 14:57:48.000000000","message":"we don\u0027t need the complication of args kwargs here, we the eventlet construct only took a single result variable (and an undocumented exc variable we don\u0027t use below), we can do that here to.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"ad2fc05d12938d22b72608bf1789e1ee4758753e","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        # event_queue is a queue.Queue with maxsize 1 for event passing"},{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"}],"source_content_type":"text/x-python","patch_set":3,"id":"34be6478_6200738b","line":249,"in_reply_to":"4db6205e_3f32db18","updated":"2025-06-25 14:28:31.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"}],"source_content_type":"text/x-python","patch_set":3,"id":"637e96c8_cd6374df","line":250,"updated":"2025-05-22 14:57:48.000000000","message":"As we don\u0027t wait on the parent event in get() we don\u0027t need to set() it either. I think the queue is enough as a synchronization point between the two threads. So we can remove the threading.Event as base.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a59fd85a250f5934ca93b32731fae8b14dcba3bd","unresolved":true,"context_lines":[{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"}],"source_content_type":"text/x-python","patch_set":3,"id":"7148278a_6596c36d","line":250,"in_reply_to":"637e96c8_cd6374df","updated":"2025-06-23 11:48:33.000000000","message":"Yepp I still think that we don\u0027t need to inherit from threading.Event, the queue is already implementing the necessary synchornization.\n\n//later\n\nOK I see it now. So you need to have is_set behavior and using the queue for it might be racy as we make two steps there\n```\n            event \u003d self.event_queue.get(timeout\u003dtimeout)\n            self.event_queue.put_nowait((event))\n```\nand inbetween the two steps the queue is empty but the event is set. \n\nHm, still it does not sit well with me that we have two synchorinzation primitives to implement one higher level one as it means we need to keep the two primitives in sync internally. I.e. threading.Event.clear() will not reset the queue to empty today in this implementation leading to a bug. Or the current code allows saying set(1), set(2) as threading.Event allows set to called repeatedly. While eventlet.Event will raise on the second send()\n```\n\u003e\u003e\u003e import eventlet\n\u003e\u003e\u003e eventlet.monkey_patch()\n\u003e\u003e\u003e event \u003d eventlet.Event()\n\u003e\u003e\u003e event.send(1)\n\u003e\u003e\u003e event.send(2)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/home/gibi/upstream/git/openstack/nova/.tox/py312/lib/python3.12/site-packages/eventlet/event.py\", line 160, in send\n    assert self._result is NOT_USED, \u0027Trying to re-send() an already-triggered event.\u0027\n           ^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Trying to re-send() an already-triggered event.\n```\n\nWhat if we ditch the queue idea. It was only a valid idea if we can solve this with a single queue. But the is_set case and the fact that we need to send the same data to multiple threads prevents us to use just a single queue synchronization primitive.\n\nWhat if we do instead (warning I did not tested this code at all):\n```\nclass ThreadingEventWithResult(threading.Event):\n\n    def __init__(self):\n        super().__init__(self)\n        self.result \u003d None\n\n    def set(result):\n        if super.is_set() and result !\u003d self.result:\n            raise ValueError(\u0027Cannot change the result once it is set\u0027)\n        self.result \u003d result\n        super().set()\n        \n    # def is_set() will work as needed automatically\n    # def clear() will work too I guess\n    \n    def wait(self, timeout\u003dNone):\n        succeeded \u003d super().wait(timeout)\n        if succeeded:\n           return self.result\n        else:\n            return False\n```","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"ad2fc05d12938d22b72608bf1789e1ee4758753e","unresolved":false,"context_lines":[{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"}],"source_content_type":"text/x-python","patch_set":3,"id":"5ebfa240_bd15c3e7","line":250,"in_reply_to":"7148278a_6596c36d","updated":"2025-06-25 14:28:31.000000000","message":"Thanks, done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"},{"line_number":254,"context_line":"            self.event_queue.put_nowait((args, kwargs))"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"c8f5c118_729ed321","line":252,"updated":"2025-05-22 14:57:48.000000000","message":"I\u0027m wondering why we need this. I think eventlet.Event supported sending None","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    def set(self, *args, **kwargs):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"},{"line_number":254,"context_line":"            self.event_queue.put_nowait((args, kwargs))"},{"line_number":255,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ad496f8b_a8c1c29c","line":252,"in_reply_to":"c8f5c118_729ed321","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"},{"line_number":254,"context_line":"            self.event_queue.put_nowait((args, kwargs))"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":257,"context_line":"        self.wait(timeout\u003dtimeout)  # Wait for the event to be set"}],"source_content_type":"text/x-python","patch_set":3,"id":"4d94bfa7_68466dd9","line":254,"updated":"2025-05-22 14:57:48.000000000","message":"if put_nowait raises Full that means that the same \"event\" was set twice. This was not supported by the eventlet.Event so we can raise as well so this is good as is.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        # If any args or kwargs are provided, put them onto the queue"},{"line_number":252,"context_line":"        if args or kwargs:"},{"line_number":253,"context_line":"            # Put a tuple of (args, kwargs) onto the queue"},{"line_number":254,"context_line":"            self.event_queue.put_nowait((args, kwargs))"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":257,"context_line":"        self.wait(timeout\u003dtimeout)  # Wait for the event to be set"}],"source_content_type":"text/x-python","patch_set":3,"id":"080d2114_932b6212","line":254,"in_reply_to":"4d94bfa7_68466dd9","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":256,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":257,"context_line":"        self.wait(timeout\u003dtimeout)  # Wait for the event to be set"},{"line_number":258,"context_line":"        try:"},{"line_number":259,"context_line":"            return self.event_queue.get(timeout\u003dtimeout)"},{"line_number":260,"context_line":"        except queue.Empty:"},{"line_number":261,"context_line":"            return None"},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3df0a24f_80a13d8c","line":259,"updated":"2025-05-22 14:57:48.000000000","message":"This is a typical race condition. Between the first and the second wait another thread could come in and consume the content of the queue.\n\nAs queue.get() has a timeout option we don\u0027t need a wait on anything else just on the queue. It has the benefit that either the queue returns a piece of data or raise due to timing out so there is no race window.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9bb430ef6154505c378163b9dbf995de63c57bb4","unresolved":true,"context_lines":[{"line_number":256,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":257,"context_line":"        self.wait(timeout\u003dtimeout)  # Wait for the event to be set"},{"line_number":258,"context_line":"        try:"},{"line_number":259,"context_line":"            return self.event_queue.get(timeout\u003dtimeout)"},{"line_number":260,"context_line":"        except queue.Empty:"},{"line_number":261,"context_line":"            return None"},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"a98f2f5d_a9dd9658","line":259,"in_reply_to":"3df0a24f_80a13d8c","updated":"2025-05-22 14:59:45.000000000","message":"sorry between the first wait and the second wait happening in get()","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":256,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":257,"context_line":"        self.wait(timeout\u003dtimeout)  # Wait for the event to be set"},{"line_number":258,"context_line":"        try:"},{"line_number":259,"context_line":"            return self.event_queue.get(timeout\u003dtimeout)"},{"line_number":260,"context_line":"        except queue.Empty:"},{"line_number":261,"context_line":"            return None"},{"line_number":262,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"124c3435_097024de","line":259,"in_reply_to":"a98f2f5d_a9dd9658","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":456,"context_line":"            self.status \u003d self.WAITING"},{"line_number":457,"context_line":"            try:"},{"line_number":458,"context_line":"                with timeutils.StopWatch() as sw:"},{"line_number":459,"context_line":"                    instance_event \u003d self.event.wait()"},{"line_number":460,"context_line":"            except queue.Empty:"},{"line_number":461,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":462,"context_line":"                self.wait_time \u003d sw.elapsed()"}],"source_content_type":"text/x-python","patch_set":3,"id":"28cd4b04_9783f707","line":459,"updated":"2025-05-22 14:57:48.000000000","message":"I guess you wanted to pass the timeout to self.event.wait(timeout)","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"ad2fc05d12938d22b72608bf1789e1ee4758753e","unresolved":false,"context_lines":[{"line_number":456,"context_line":"            self.status \u003d self.WAITING"},{"line_number":457,"context_line":"            try:"},{"line_number":458,"context_line":"                with timeutils.StopWatch() as sw:"},{"line_number":459,"context_line":"                    instance_event \u003d self.event.wait()"},{"line_number":460,"context_line":"            except queue.Empty:"},{"line_number":461,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":462,"context_line":"                self.wait_time \u003d sw.elapsed()"}],"source_content_type":"text/x-python","patch_set":3,"id":"73128e34_79cf196f","line":459,"in_reply_to":"28cd4b04_9783f707","updated":"2025-06-25 14:28:31.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":581,"context_line":"        try:"},{"line_number":582,"context_line":"            self._wait_for_instance_events("},{"line_number":583,"context_line":"                instance, events, error_callback, deadline)"},{"line_number":584,"context_line":"        except queue.Empty:"},{"line_number":585,"context_line":"            LOG.warning("},{"line_number":586,"context_line":"                \u0027Timeout waiting for %(events)s for instance with \u0027"},{"line_number":587,"context_line":"                \u0027vm_state %(vm_state)s and task_state %(task_state)s. \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f42a3fb_34b45cc8","line":584,"updated":"2025-05-22 14:57:48.000000000","message":"yeah I think this is technically correct it just read pretty weird. As we have its own class we can wrap the queue.Empty exception to a new Timeout exception to make the code more readable.","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":581,"context_line":"        try:"},{"line_number":582,"context_line":"            self._wait_for_instance_events("},{"line_number":583,"context_line":"                instance, events, error_callback, deadline)"},{"line_number":584,"context_line":"        except queue.Empty:"},{"line_number":585,"context_line":"            LOG.warning("},{"line_number":586,"context_line":"                \u0027Timeout waiting for %(events)s for instance with \u0027"},{"line_number":587,"context_line":"                \u0027vm_state %(vm_state)s and task_state %(task_state)s. \u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"b0f8160a_979288b1","line":584,"in_reply_to":"9f42a3fb_34b45cc8","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2976d592669e03f18ffffc0cac829c37f3a02ac8","unresolved":true,"context_lines":[{"line_number":11518,"context_line":"        if _event:"},{"line_number":11519,"context_line":"            LOG.debug(\u0027Processing event %(event)s\u0027,"},{"line_number":11520,"context_line":"                      {\u0027event\u0027: event.key}, instance\u003dinstance)"},{"line_number":11521,"context_line":"            _event.set()"},{"line_number":11522,"context_line":"        else:"},{"line_number":11523,"context_line":"            # If it\u0027s a network-vif-unplugged event and the instance is being"},{"line_number":11524,"context_line":"            # deleted or live migrated then we don\u0027t need to make this a"}],"source_content_type":"text/x-python","patch_set":3,"id":"a093fa0f_c6afa57a","line":11521,"updated":"2025-05-22 14:57:48.000000000","message":"You removed the data being sent. Is it intentional? Did you checked that the other end does not use the data being sent form here?","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":11518,"context_line":"        if _event:"},{"line_number":11519,"context_line":"            LOG.debug(\u0027Processing event %(event)s\u0027,"},{"line_number":11520,"context_line":"                      {\u0027event\u0027: event.key}, instance\u003dinstance)"},{"line_number":11521,"context_line":"            _event.set()"},{"line_number":11522,"context_line":"        else:"},{"line_number":11523,"context_line":"            # If it\u0027s a network-vif-unplugged event and the instance is being"},{"line_number":11524,"context_line":"            # deleted or live migrated then we don\u0027t need to make this a"}],"source_content_type":"text/x-python","patch_set":3,"id":"4dfa4302_7fa43bc3","line":11521,"in_reply_to":"a093fa0f_c6afa57a","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"7ba1592ae4d184e22b9393122814c7a92ec0660f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a59fd85a250f5934ca93b32731fae8b14dcba3bd","unresolved":true,"context_lines":[{"line_number":246,"context_line":"        # event_queue is a queue.Queue with maxsize 1 for event passing"},{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, event\u003dNone):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        self.event_queue.put_nowait((event))"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"695a1aaa_9be1723d","line":249,"updated":"2025-06-23 11:48:33.000000000","message":"* nit: I would call the parameter \"result\" to avoid confusion between the ThreadingEvent and the parameter event here.\n\nWe can default the parameter to ensure:\n* it matches the eventlet.Event interface behavior\n* after the transformation of the code we can see which place does not pass anything to set() and those places can be replaced directly with threading.Event.\n\nThe default value might be problematic to match with the threadng.Event.wait() expected return value. I have to think about it. See below","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        # event_queue is a queue.Queue with maxsize 1 for event passing"},{"line_number":247,"context_line":"        self.event_queue: queue.Queue \u003d queue.Queue(maxsize\u003d1)"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, event\u003dNone):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        self.event_queue.put_nowait((event))"},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"a3858419_ca3ab8dc","line":249,"in_reply_to":"695a1aaa_9be1723d","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a59fd85a250f5934ca93b32731fae8b14dcba3bd","unresolved":true,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, event\u003dNone):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        self.event_queue.put_nowait((event))"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5270e6b9_4ed5fd88","line":251,"updated":"2025-06-23 11:48:33.000000000","message":"nit the double \"(\" is redundant, or not what you want. If you want a tuple with a single item then it should be (event,).","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def set(self, event\u003dNone):"},{"line_number":250,"context_line":"        super().set()"},{"line_number":251,"context_line":"        self.event_queue.put_nowait((event))"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"dc6801f1_fcd5c91f","line":251,"in_reply_to":"5270e6b9_4ed5fd88","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a59fd85a250f5934ca93b32731fae8b14dcba3bd","unresolved":true,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        try:"},{"line_number":255,"context_line":"            event \u003d self.event_queue.get(timeout\u003dtimeout)"},{"line_number":256,"context_line":"            self.event_queue.put_nowait((event))"},{"line_number":257,"context_line":"            return event"},{"line_number":258,"context_line":"        except queue.Empty:"},{"line_number":259,"context_line":"            return None"},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"62115d42_949f51e1","line":257,"range":{"start_line":255,"start_character":1,"end_line":257,"end_character":24},"updated":"2025-06-23 11:48:33.000000000","message":"OK this is clever. It worth a comment to explain that we put the result back to the queue immediately so that multiple threads waiting on the return of the wait() call will get the same value as it was with eventlet.Event.","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        try:"},{"line_number":255,"context_line":"            event \u003d self.event_queue.get(timeout\u003dtimeout)"},{"line_number":256,"context_line":"            self.event_queue.put_nowait((event))"},{"line_number":257,"context_line":"            return event"},{"line_number":258,"context_line":"        except queue.Empty:"},{"line_number":259,"context_line":"            return None"},{"line_number":260,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"767ce65d_ed0b893e","line":257,"range":{"start_line":255,"start_character":1,"end_line":257,"end_character":24},"in_reply_to":"62115d42_949f51e1","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a59fd85a250f5934ca93b32731fae8b14dcba3bd","unresolved":true,"context_lines":[{"line_number":256,"context_line":"            self.event_queue.put_nowait((event))"},{"line_number":257,"context_line":"            return event"},{"line_number":258,"context_line":"        except queue.Empty:"},{"line_number":259,"context_line":"            return None"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"# Each collection of events is a dict of eventlet Events keyed by a tuple of"}],"source_content_type":"text/x-python","patch_set":5,"id":"35351eec_1b2718fb","line":259,"updated":"2025-06-23 11:48:33.000000000","message":"We have to think about what we return:\n\n1. in case of timeout we need to return None to keep the eventlet.Event behavior.\nHowever the threading.Event:\n\n\u003e The return value represents the reason that this blocking method returned; True if returning because the internal flag is set to true, or False if a timeout is given and the internal flag did not become true within the given wait time.\n\nBased on this here we should return False to be forward compatible with threading.Event. We need to check every places we replace to see how the return value of wait() is handled. If it only checked in a boolean context like:\n```\nresult \u003d event.wait(timeout)\nif result:\n```\nthen changing from None to False return value is safe. If there are explicit None checks like:\n```\nresult \u003d event.wait(timeout)\nif result is not None:\n```\nthen we need to manually change those places to work with False return value.\n\n2. in case of set() the wait() will return None as result send\u0027s parameter is defaulted to None. This is aligned with the eventlet.Event behavior (with send()). However the threading.Event:\n\n\u003e The return value represents the reason that this blocking method returned; True if returning because the internal flag is set to true, or False if a timeout is given and the internal flag did not become true within the given wait time.\n\nBased on this here we should return True to be forward compatible with threading.Event.\n\nWe should check if all replaced send() call is passing a non None value. If so then we can simply change the default to send(result\u003dTrue) or even remove the defaulting and make the param mandatory. If there are cases where we currently use send() those are not sending values between threads so we can use threading.Event there directly.\n\n3. in case of set(foo) the wait() will return foo. That matches eventlet.Event and has no comparable behavior with threading.Event. So good.","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"753e259ce27679d5b82414a764fcdbfe9754b2de","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            self.event_queue.put_nowait((event))"},{"line_number":257,"context_line":"            return event"},{"line_number":258,"context_line":"        except queue.Empty:"},{"line_number":259,"context_line":"            return None"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"# Each collection of events is a dict of eventlet Events keyed by a tuple of"}],"source_content_type":"text/x-python","patch_set":5,"id":"ca9ea60e_8964f2b3","line":259,"in_reply_to":"35351eec_1b2718fb","updated":"2025-07-03 07:29:27.000000000","message":"Done","commit_id":"3759d8f2e0199d0915c5eeb216d1835f185835e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"220a09d158eae4c25108503b3a5fc1b2b2060782","unresolved":true,"context_lines":[{"line_number":313,"context_line":"        :param instance: the instance for which the event was generated"},{"line_number":314,"context_line":"        :param event: the nova.objects.external_event.InstanceExternalEvent"},{"line_number":315,"context_line":"                      that describes the event"},{"line_number":316,"context_line":"        :returns: the threading.Event object on which the waiters"},{"line_number":317,"context_line":"                  are blocked"},{"line_number":318,"context_line":"        \"\"\""},{"line_number":319,"context_line":"        no_events_sentinel \u003d object()"}],"source_content_type":"text/x-python","patch_set":11,"id":"6f1699b1_98b4c2f8","line":316,"updated":"2025-06-27 08:25:09.000000000","message":"is it threading.Event or the new ThreadingEventWithResult?","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2b20afdeafe1c024c0c50977d2bb51071c552fee","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        :param instance: the instance for which the event was generated"},{"line_number":314,"context_line":"        :param event: the nova.objects.external_event.InstanceExternalEvent"},{"line_number":315,"context_line":"                      that describes the event"},{"line_number":316,"context_line":"        :returns: the threading.Event object on which the waiters"},{"line_number":317,"context_line":"                  are blocked"},{"line_number":318,"context_line":"        \"\"\""},{"line_number":319,"context_line":"        no_events_sentinel \u003d object()"}],"source_content_type":"text/x-python","patch_set":11,"id":"37118c43_de38a848","line":316,"in_reply_to":"6f1699b1_98b4c2f8","updated":"2025-07-02 10:02:37.000000000","message":"Done","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"220a09d158eae4c25108503b3a5fc1b2b2060782","unresolved":true,"context_lines":[{"line_number":363,"context_line":"        and return them (indexed by event name)."},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"        :param instance: the instance for which events should be purged"},{"line_number":366,"context_line":"        :returns: a dictionary of {event_name: threading.Event}"},{"line_number":367,"context_line":"        \"\"\""},{"line_number":368,"context_line":"        @utils.synchronized(self._lock_name(instance))"},{"line_number":369,"context_line":"        def _clear_events():"}],"source_content_type":"text/x-python","patch_set":11,"id":"cecca50e_b46152d6","line":366,"updated":"2025-06-27 08:25:09.000000000","message":"is it threading.Event or ThreadingEventWithResult ?","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2b20afdeafe1c024c0c50977d2bb51071c552fee","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        and return them (indexed by event name)."},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"        :param instance: the instance for which events should be purged"},{"line_number":366,"context_line":"        :returns: a dictionary of {event_name: threading.Event}"},{"line_number":367,"context_line":"        \"\"\""},{"line_number":368,"context_line":"        @utils.synchronized(self._lock_name(instance))"},{"line_number":369,"context_line":"        def _clear_events():"}],"source_content_type":"text/x-python","patch_set":11,"id":"2f8ab3c7_f360deac","line":366,"in_reply_to":"cecca50e_b46152d6","updated":"2025-07-02 10:02:37.000000000","message":"Done","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"220a09d158eae4c25108503b3a5fc1b2b2060782","unresolved":true,"context_lines":[{"line_number":433,"context_line":"        TIMED_OUT \u003d \"timed out\""},{"line_number":434,"context_line":"        RECEIVED_NOT_PROCESSED \u003d \"received but not processed\""},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        def __init__(self, name: str, event: threading.Event) -\u003e None:"},{"line_number":437,"context_line":"            self.name \u003d name"},{"line_number":438,"context_line":"            self.event \u003d event"},{"line_number":439,"context_line":"            self.status \u003d self.EXPECTED"}],"source_content_type":"text/x-python","patch_set":11,"id":"58860b6a_2a86dd94","line":436,"updated":"2025-06-27 08:25:09.000000000","message":"isn\u0027t it ThreadingEventWithResult ?","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2b20afdeafe1c024c0c50977d2bb51071c552fee","unresolved":false,"context_lines":[{"line_number":433,"context_line":"        TIMED_OUT \u003d \"timed out\""},{"line_number":434,"context_line":"        RECEIVED_NOT_PROCESSED \u003d \"received but not processed\""},{"line_number":435,"context_line":""},{"line_number":436,"context_line":"        def __init__(self, name: str, event: threading.Event) -\u003e None:"},{"line_number":437,"context_line":"            self.name \u003d name"},{"line_number":438,"context_line":"            self.event \u003d event"},{"line_number":439,"context_line":"            self.status \u003d self.EXPECTED"}],"source_content_type":"text/x-python","patch_set":11,"id":"f13da785_3fccc06c","line":436,"in_reply_to":"58860b6a_2a86dd94","updated":"2025-07-02 10:02:37.000000000","message":"Done","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"220a09d158eae4c25108503b3a5fc1b2b2060782","unresolved":true,"context_lines":[{"line_number":454,"context_line":"            try:"},{"line_number":455,"context_line":"                with timeutils.StopWatch() as sw:"},{"line_number":456,"context_line":"                    instance_event \u003d self.event.wait()"},{"line_number":457,"context_line":"            except eventlet.timeout.Timeout:"},{"line_number":458,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":459,"context_line":"                self.wait_time \u003d sw.elapsed()"},{"line_number":460,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"25461917_0cb0ec25","line":457,"updated":"2025-06-27 08:25:09.000000000","message":"this eventlet specific exception needs to go away now that the code inside is not eventlet specific. The threading.Event timeout is signalled by returning False from wait()","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2b20afdeafe1c024c0c50977d2bb51071c552fee","unresolved":false,"context_lines":[{"line_number":454,"context_line":"            try:"},{"line_number":455,"context_line":"                with timeutils.StopWatch() as sw:"},{"line_number":456,"context_line":"                    instance_event \u003d self.event.wait()"},{"line_number":457,"context_line":"            except eventlet.timeout.Timeout:"},{"line_number":458,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":459,"context_line":"                self.wait_time \u003d sw.elapsed()"},{"line_number":460,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9feb1847_c66a03ea","line":457,"in_reply_to":"25461917_0cb0ec25","updated":"2025-07-02 10:02:37.000000000","message":"Done","commit_id":"247013a89a23bc80c1446eb7d9e2638bb7dd3082"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":true,"context_lines":[{"line_number":238,"context_line":"    return decorated_function"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def __init__(self):"},{"line_number":244,"context_line":"        super().__init__()"}],"source_content_type":"text/x-python","patch_set":16,"id":"28b895b8_a404609f","line":241,"updated":"2025-07-04 13:29:10.000000000","message":"Lets have a set of unit test for this class describing how it behaves","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fc5471b9ab2af58871ead83bfae670dc09c01a26","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    return decorated_function"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def __init__(self):"},{"line_number":244,"context_line":"        super().__init__()"}],"source_content_type":"text/x-python","patch_set":16,"id":"cd919175_576b2d8c","line":241,"in_reply_to":"28b895b8_a404609f","updated":"2025-07-07 14:44:08.000000000","message":"Done","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8fb93799c79b250a3113b012797849ad324ec72d","unresolved":true,"context_lines":[{"line_number":238,"context_line":"    return decorated_function"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def __init__(self):"},{"line_number":244,"context_line":"        super().__init__()"},{"line_number":245,"context_line":"        self.result \u003d None"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def set(self, result\u003dNone):"},{"line_number":248,"context_line":"        if super().is_set() and result !\u003d self.result:"},{"line_number":249,"context_line":"            raise ValueError(\u0027Cannot change the result once it is set\u0027)"},{"line_number":250,"context_line":"        self.result \u003d result"},{"line_number":251,"context_line":"        super().set()"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":255,"context_line":"        if succeeded:"},{"line_number":256,"context_line":"            return self.result"},{"line_number":257,"context_line":"        else:"},{"line_number":258,"context_line":"            return False"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"# Each collection of events is a dict of eventlet Events keyed by a tuple of"}],"source_content_type":"text/x-python","patch_set":17,"id":"e73f9744_0d425929","line":258,"range":{"start_line":241,"start_character":0,"end_line":258,"end_character":24},"updated":"2025-07-08 13:19:04.000000000","message":"this is a littel sus.\n\nwe are conflating tow meaning of False potentially.\n\ni wonder if it would be better to create to class level sentalal object for unset and failed\n\n```suggestion\nclass ThreadingEventWithResult(threading.Event):\n\n    UNSET_SENTINEL \u003d object()\n    FAILED_SENTINEL \u003d object()\n\n    def __init__(self):\n        super().__init__()\n        self.result \u003d self.UNSET_SENTINEL\n\n    def set(self, result\u003dNone):\n        if super().is_set() and result !\u003d self.result:\n            raise ValueError(\u0027Cannot change the result once it is set\u0027)\n        self.result \u003d result\n        super().set()\n\n    def wait(self, timeout\u003dNone):\n        succeeded \u003d super().wait(timeout)\n        if succeeded:\n            return self.result\n        else:\n            return self.FAILED_SENTINEL\n```\n\nthen you can check ThreadingEventWithResult.FAILED_SENTINEL later when you actully need to instead of False.\n\n\nby the way this is closer to a future then it is to an event. i wonder if we shoudl just use a future instead?\n\nfuture suppoort carrying a result including excptions that can be raised when you try to get the result and you can pass a time out to them\n\nso i think if we are using an event to return a result we shoudl have been using a future there instead.","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fb2551ff462f65fbb31c37630eafb8a4fa30a698","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    return decorated_function"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def __init__(self):"},{"line_number":244,"context_line":"        super().__init__()"},{"line_number":245,"context_line":"        self.result \u003d None"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def set(self, result\u003dNone):"},{"line_number":248,"context_line":"        if super().is_set() and result !\u003d self.result:"},{"line_number":249,"context_line":"            raise ValueError(\u0027Cannot change the result once it is set\u0027)"},{"line_number":250,"context_line":"        self.result \u003d result"},{"line_number":251,"context_line":"        super().set()"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":255,"context_line":"        if succeeded:"},{"line_number":256,"context_line":"            return self.result"},{"line_number":257,"context_line":"        else:"},{"line_number":258,"context_line":"            return False"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"# Each collection of events is a dict of eventlet Events keyed by a tuple of"}],"source_content_type":"text/x-python","patch_set":17,"id":"abd1dc33_52a848a5","line":258,"range":{"start_line":241,"start_character":0,"end_line":258,"end_character":24},"in_reply_to":"363bbe28_4f23eda5","updated":"2025-07-09 09:52:40.000000000","message":"Done","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"f17eb128628c5fb8d661405361490d147a63ea12","unresolved":true,"context_lines":[{"line_number":238,"context_line":"    return decorated_function"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"    def __init__(self):"},{"line_number":244,"context_line":"        super().__init__()"},{"line_number":245,"context_line":"        self.result \u003d None"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def set(self, result\u003dNone):"},{"line_number":248,"context_line":"        if super().is_set() and result !\u003d self.result:"},{"line_number":249,"context_line":"            raise ValueError(\u0027Cannot change the result once it is set\u0027)"},{"line_number":250,"context_line":"        self.result \u003d result"},{"line_number":251,"context_line":"        super().set()"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":254,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":255,"context_line":"        if succeeded:"},{"line_number":256,"context_line":"            return self.result"},{"line_number":257,"context_line":"        else:"},{"line_number":258,"context_line":"            return False"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"# Each collection of events is a dict of eventlet Events keyed by a tuple of"}],"source_content_type":"text/x-python","patch_set":17,"id":"363bbe28_4f23eda5","line":258,"range":{"start_line":241,"start_character":0,"end_line":258,"end_character":24},"in_reply_to":"e73f9744_0d425929","updated":"2025-07-08 14:28:45.000000000","message":"so i chatted to gibi about this and while i fundementlly stilll think this is a future  they pointed out that set_result is a private method https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future.set_result\n\n\nso while they fixed this for asyncio https://docs.python.org/3/library/asyncio-future.html#asyncio.Future.set_result\n\nwe are not using that.\n\nthe many handeler get the same resuslt behavior is also not standard for a future\n\nso over all i agree with keepign the ThreadingEventWithResult classs.\n\nwe may end up moving this if there are other usecase for this behavior but im ok with keeing it in this module for now.","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8fb93799c79b250a3113b012797849ad324ec72d","unresolved":true,"context_lines":[{"line_number":453,"context_line":"            self.status \u003d self.WAITING"},{"line_number":454,"context_line":"            with timeutils.StopWatch() as sw:"},{"line_number":455,"context_line":"                instance_event \u003d self.event.wait()"},{"line_number":456,"context_line":"            if instance_event is False:"},{"line_number":457,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":458,"context_line":"                self.wait_time \u003d sw.elapsed()"},{"line_number":459,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":17,"id":"94acc608_618a711e","line":456,"updated":"2025-07-08 13:19:04.000000000","message":"so this would be\n\n```suggestion\n            if instance_event is ThreadingEventWithResult.FAILED_SENTINEL:\n```","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fb2551ff462f65fbb31c37630eafb8a4fa30a698","unresolved":false,"context_lines":[{"line_number":453,"context_line":"            self.status \u003d self.WAITING"},{"line_number":454,"context_line":"            with timeutils.StopWatch() as sw:"},{"line_number":455,"context_line":"                instance_event \u003d self.event.wait()"},{"line_number":456,"context_line":"            if instance_event is False:"},{"line_number":457,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":458,"context_line":"                self.wait_time \u003d sw.elapsed()"},{"line_number":459,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":17,"id":"a86706f8_c4fb35f9","line":456,"in_reply_to":"94acc608_618a711e","updated":"2025-07-09 09:52:40.000000000","message":"Done","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f0ea835ff171e377415ddb4c9fd29cd8897e6096","unresolved":true,"context_lines":[{"line_number":110,"context_line":"    exception_wrapper.wrap_exception, service\u003d\u0027compute\u0027, binary\u003d\u0027nova-compute\u0027)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class ThreadingTimeout(Exception):"},{"line_number":114,"context_line":"    \"\"\"A custom timeout exception to replace eventlet.timeout.Timeout.\"\"\""},{"line_number":115,"context_line":"    pass"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"1e9c0b4c_7f43527a","line":113,"updated":"2025-07-18 13:59:50.000000000","message":"As we are not raising this directly from ThreadingEventWithResult it is not really a generic exception for threads that timing out. So the name is misleading. We only raise it from _wait_for_instance_events so lets call it InstanceEventTimeout.\n\nAlso for historical reasons most of our exceptions are defined in nova/exception so this should be as well.","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"192bde0d4ceb61da9ea7681e5d20c43fc07a7ddb","unresolved":false,"context_lines":[{"line_number":110,"context_line":"    exception_wrapper.wrap_exception, service\u003d\u0027compute\u0027, binary\u003d\u0027nova-compute\u0027)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class ThreadingTimeout(Exception):"},{"line_number":114,"context_line":"    \"\"\"A custom timeout exception to replace eventlet.timeout.Timeout.\"\"\""},{"line_number":115,"context_line":"    pass"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"f4aac212_f2e5700d","line":113,"in_reply_to":"1e9c0b4c_7f43527a","updated":"2025-07-21 12:07:16.000000000","message":"Done","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f0ea835ff171e377415ddb4c9fd29cd8897e6096","unresolved":true,"context_lines":[{"line_number":243,"context_line":"    return decorated_function"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"    UNSET_SENTINEL \u003d object()"},{"line_number":249,"context_line":"    FAILED_SENTINEL \u003d object()"}],"source_content_type":"text/x-python","patch_set":19,"id":"f0b59c1e_e5dc72c0","line":246,"updated":"2025-07-18 13:59:50.000000000","message":"* please add unit test coverage for the logic in this class.\n\n* also I would move this to a bit more common place maybe nova/utils","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"192bde0d4ceb61da9ea7681e5d20c43fc07a7ddb","unresolved":false,"context_lines":[{"line_number":243,"context_line":"    return decorated_function"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"class ThreadingEventWithResult(threading.Event):"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"    UNSET_SENTINEL \u003d object()"},{"line_number":249,"context_line":"    FAILED_SENTINEL \u003d object()"}],"source_content_type":"text/x-python","patch_set":19,"id":"1a24b7f7_efa56115","line":246,"in_reply_to":"f0b59c1e_e5dc72c0","updated":"2025-07-21 12:07:16.000000000","message":"Done","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2b4631f55c352e45e33be6f8631c38c6919b253c","unresolved":true,"context_lines":[{"line_number":255,"context_line":"    def set(self, result\u003dNone):"},{"line_number":256,"context_line":"        if super().is_set() and result !\u003d self.result:"},{"line_number":257,"context_line":"            raise ValueError(\u0027Cannot change the result once it is set\u0027)"},{"line_number":258,"context_line":"        self.result \u003d result"},{"line_number":259,"context_line":"        super().set()"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":262,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":263,"context_line":"        if succeeded:"}],"source_content_type":"text/x-python","patch_set":19,"id":"b8be2aad_855ca873","line":260,"range":{"start_line":258,"start_character":7,"end_line":260,"end_character":0},"updated":"2025-07-21 06:54:48.000000000","message":"I think this has a race condition in the following scenario.\nTwo threads T1 T2 and one event E1:\n* E1 is created and a ref is passed to both T1 and T2 and both threads are started.\n* T1 calls E1.set(foo). As at this point self.is_set is False the condition is skipped. Then self.result \u003d foo is exectuted.\n* Assume contextswitch happens at this point. T2 calls E1.set(bar). The self.is_set is still false so the condition is skipped. Then self.result is set to bar overwriting T1\u0027s effect there. Then super().set() is called and T2 finishes.\n* T1 resumed and calls super().set() which is not an error in Event then finishes.\n\nSo both T1 and T2 can think it set the result in E1.\n\nI think we need a lock to avoid this.","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"192bde0d4ceb61da9ea7681e5d20c43fc07a7ddb","unresolved":false,"context_lines":[{"line_number":255,"context_line":"    def set(self, result\u003dNone):"},{"line_number":256,"context_line":"        if super().is_set() and result !\u003d self.result:"},{"line_number":257,"context_line":"            raise ValueError(\u0027Cannot change the result once it is set\u0027)"},{"line_number":258,"context_line":"        self.result \u003d result"},{"line_number":259,"context_line":"        super().set()"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":262,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":263,"context_line":"        if succeeded:"}],"source_content_type":"text/x-python","patch_set":19,"id":"66824489_3006486e","line":260,"range":{"start_line":258,"start_character":7,"end_line":260,"end_character":0},"in_reply_to":"b8be2aad_855ca873","updated":"2025-07-21 12:07:16.000000000","message":"Done","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f0ea835ff171e377415ddb4c9fd29cd8897e6096","unresolved":true,"context_lines":[{"line_number":464,"context_line":"            if instance_event is ThreadingEventWithResult.FAILED_SENTINEL:"},{"line_number":465,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":466,"context_line":"                self.wait_time \u003d sw.elapsed()"},{"line_number":467,"context_line":"                return False"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"            self.status \u003d self.RECEIVED"},{"line_number":470,"context_line":"            self.wait_time \u003d sw.elapsed()"}],"source_content_type":"text/x-python","patch_set":19,"id":"35521808_fa0ccd88","line":467,"updated":"2025-07-18 13:59:50.000000000","message":"so False signals timeout while waiting for an event.","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"192bde0d4ceb61da9ea7681e5d20c43fc07a7ddb","unresolved":false,"context_lines":[{"line_number":464,"context_line":"            if instance_event is ThreadingEventWithResult.FAILED_SENTINEL:"},{"line_number":465,"context_line":"                self.status \u003d self.TIMED_OUT"},{"line_number":466,"context_line":"                self.wait_time \u003d sw.elapsed()"},{"line_number":467,"context_line":"                return False"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"            self.status \u003d self.RECEIVED"},{"line_number":470,"context_line":"            self.wait_time \u003d sw.elapsed()"}],"source_content_type":"text/x-python","patch_set":19,"id":"cfea668b_e8317875","line":467,"in_reply_to":"35521808_fa0ccd88","updated":"2025-07-21 12:07:16.000000000","message":"Done","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f0ea835ff171e377415ddb4c9fd29cd8897e6096","unresolved":true,"context_lines":[{"line_number":499,"context_line":"            if remaining_time \u003c\u003d 0:"},{"line_number":500,"context_line":"                raise ThreadingTimeout()"},{"line_number":501,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":502,"context_line":"            if actual_event is None:"},{"line_number":503,"context_line":"                # This indicates a timeout from _InstanceEvent.wait"},{"line_number":504,"context_line":"                raise ThreadingTimeout()"},{"line_number":505,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"}],"source_content_type":"text/x-python","patch_set":19,"id":"3a1b7965_403a3105","line":502,"updated":"2025-07-18 13:59:50.000000000","message":"but here we check that the result is None. So this will not be true afaik as we return False at 467.","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"192bde0d4ceb61da9ea7681e5d20c43fc07a7ddb","unresolved":false,"context_lines":[{"line_number":499,"context_line":"            if remaining_time \u003c\u003d 0:"},{"line_number":500,"context_line":"                raise ThreadingTimeout()"},{"line_number":501,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":502,"context_line":"            if actual_event is None:"},{"line_number":503,"context_line":"                # This indicates a timeout from _InstanceEvent.wait"},{"line_number":504,"context_line":"                raise ThreadingTimeout()"},{"line_number":505,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"}],"source_content_type":"text/x-python","patch_set":19,"id":"0bdb5444_b67147d4","line":502,"in_reply_to":"3a1b7965_403a3105","updated":"2025-07-21 12:07:16.000000000","message":"Done","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f0ea835ff171e377415ddb4c9fd29cd8897e6096","unresolved":true,"context_lines":[{"line_number":501,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":502,"context_line":"            if actual_event is None:"},{"line_number":503,"context_line":"                # This indicates a timeout from _InstanceEvent.wait"},{"line_number":504,"context_line":"                raise ThreadingTimeout()"},{"line_number":505,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"},{"line_number":506,"context_line":"                continue"},{"line_number":507,"context_line":"            # If we get here, we have an event that was not completed,"}],"source_content_type":"text/x-python","patch_set":19,"id":"0100821c_8471b1f6","line":504,"updated":"2025-07-18 13:59:50.000000000","message":"and translate that to an exeception. \n\nSo the same signal of timeout is going through 3 transformation\n* we return the sentinel from ThreadingEventWithResult\n* then translate that to False\n* then translate that to ThreadingTimeout\n\nI think it would be simpler to translating the sentinel to ThreadingTimeout already at L467","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"192bde0d4ceb61da9ea7681e5d20c43fc07a7ddb","unresolved":false,"context_lines":[{"line_number":501,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":502,"context_line":"            if actual_event is None:"},{"line_number":503,"context_line":"                # This indicates a timeout from _InstanceEvent.wait"},{"line_number":504,"context_line":"                raise ThreadingTimeout()"},{"line_number":505,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"},{"line_number":506,"context_line":"                continue"},{"line_number":507,"context_line":"            # If we get here, we have an event that was not completed,"}],"source_content_type":"text/x-python","patch_set":19,"id":"3ece19a3_8d964a28","line":504,"in_reply_to":"0100821c_8471b1f6","updated":"2025-07-21 12:07:16.000000000","message":"Done","commit_id":"cc8f4e9c3d80c534e500855ecbd54a7d98f204b0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from cinderclient import exceptions as cinder_exception"},{"line_number":42,"context_line":"from cursive import exception as cursive_exception"},{"line_number":43,"context_line":"import eventlet.timeout"},{"line_number":44,"context_line":"import futurist"},{"line_number":45,"context_line":"from keystoneauth1 import exceptions as keystone_exception"},{"line_number":46,"context_line":"from openstack import exceptions as sdk_exc"}],"source_content_type":"text/x-python","patch_set":20,"id":"c49a141e_ff8da821","line":43,"updated":"2025-07-22 15:28:24.000000000","message":"Is is still used somewhere?","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from cinderclient import exceptions as cinder_exception"},{"line_number":42,"context_line":"from cursive import exception as cursive_exception"},{"line_number":43,"context_line":"import eventlet.timeout"},{"line_number":44,"context_line":"import futurist"},{"line_number":45,"context_line":"from keystoneauth1 import exceptions as keystone_exception"},{"line_number":46,"context_line":"from openstack import exceptions as sdk_exc"}],"source_content_type":"text/x-python","patch_set":20,"id":"8c905b53_a44ddfee","line":43,"in_reply_to":"c49a141e_ff8da821","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":false,"context_lines":[{"line_number":249,"context_line":"        self._lock \u003d threading.Lock()"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def set(self, result\u003dNone):"},{"line_number":252,"context_line":"        with self._lock:"},{"line_number":253,"context_line":"            if super().is_set() and result !\u003d self.result:"},{"line_number":254,"context_line":"                raise ValueError(\u0027Cannot change the result once it is set\u0027)"},{"line_number":255,"context_line":"            self.result \u003d result"}],"source_content_type":"text/x-python","patch_set":20,"id":"f4358ab3_6d21e708","line":252,"updated":"2025-07-22 15:28:24.000000000","message":"Thanks. I guess we have to live with the duplicated lock (I assume we have a lock in threading.Event as well but we should not touch it)","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            super().set()"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":259,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":260,"context_line":"        if succeeded:"},{"line_number":261,"context_line":"            return self.result"},{"line_number":262,"context_line":"        else:"},{"line_number":263,"context_line":"            return self.FAILED_SENTINEL"}],"source_content_type":"text/x-python","patch_set":20,"id":"e1089528_c2f17a2c","line":260,"range":{"start_line":259,"start_character":0,"end_line":260,"end_character":21},"updated":"2025-07-22 15:28:24.000000000","message":"This is threadsafe as wait is threadsafe and succeeded is a local variable.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":false,"context_lines":[{"line_number":258,"context_line":"    def wait(self, timeout\u003dNone):"},{"line_number":259,"context_line":"        succeeded \u003d super().wait(timeout)"},{"line_number":260,"context_line":"        if succeeded:"},{"line_number":261,"context_line":"            return self.result"},{"line_number":262,"context_line":"        else:"},{"line_number":263,"context_line":"            return self.FAILED_SENTINEL"},{"line_number":264,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9f3b1142_49c4b04c","line":261,"updated":"2025-07-22 15:28:24.000000000","message":"We can only end up here if somebody called super().set(). That can only happen via set() and there we store the result first and then call super().set(). So when we are here the self.result is already fully set. Also set() does not allow changing that value in a subsequent set() call so there could not be an in parallel mutation while we look up self.result.\nI think this is threadsafe.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        if succeeded:"},{"line_number":261,"context_line":"            return self.result"},{"line_number":262,"context_line":"        else:"},{"line_number":263,"context_line":"            return self.FAILED_SENTINEL"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"# Each collection of events is a dict of eventlet Events keyed by a tuple of"}],"source_content_type":"text/x-python","patch_set":20,"id":"43d15f4f_05a0f6c5","line":263,"updated":"2025-07-22 15:28:24.000000000","message":"this is returns a quasi constant value so it is thread safe.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":497,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":498,"context_line":"            try:"},{"line_number":499,"context_line":"                actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":500,"context_line":"            except exception.InstanceEventTimeout:"},{"line_number":501,"context_line":"                # This indicates a timeout from _InstanceEvent.wait"},{"line_number":502,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":503,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"},{"line_number":504,"context_line":"                continue"},{"line_number":505,"context_line":"            # If we get here, we have an event that was not completed,"}],"source_content_type":"text/x-python","patch_set":20,"id":"5e16c8e5_c7c3dcf0","line":502,"range":{"start_line":500,"start_character":0,"end_line":502,"end_character":54},"updated":"2025-07-22 15:28:24.000000000","message":"This can be dropped as it does not do anything else than catches and re-raises the same exception type. We can let the original exception to propagate.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":497,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":498,"context_line":"            try:"},{"line_number":499,"context_line":"                actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":500,"context_line":"            except exception.InstanceEventTimeout:"},{"line_number":501,"context_line":"                # This indicates a timeout from _InstanceEvent.wait"},{"line_number":502,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":503,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"},{"line_number":504,"context_line":"                continue"},{"line_number":505,"context_line":"            # If we get here, we have an event that was not completed,"}],"source_content_type":"text/x-python","patch_set":20,"id":"b17204d5_544374bc","line":502,"range":{"start_line":500,"start_character":0,"end_line":502,"end_character":54},"in_reply_to":"5e16c8e5_c7c3dcf0","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":2859,"context_line":"                    arqs, requested_networks)"},{"line_number":2860,"context_line":"                LOG.debug(\"ARQs for spec:%s, ARQs for network:%s\","},{"line_number":2861,"context_line":"                    spec_arqs, network_arqs)"},{"line_number":2862,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2863,"context_line":"            LOG.exception(exc)"},{"line_number":2864,"context_line":"            # ARQs created for instance or ports."},{"line_number":2865,"context_line":"            # The port binding isn\u0027t done yet."}],"source_content_type":"text/x-python","patch_set":20,"id":"c1a21d4b_06d12b6d","line":2862,"updated":"2025-07-22 15:28:24.000000000","message":"It is used here (and couple of similar places calling _get_bound_arq_resources) but I think it will not get this exception any more. See below.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":true,"context_lines":[{"line_number":2859,"context_line":"                    arqs, requested_networks)"},{"line_number":2860,"context_line":"                LOG.debug(\"ARQs for spec:%s, ARQs for network:%s\","},{"line_number":2861,"context_line":"                    spec_arqs, network_arqs)"},{"line_number":2862,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2863,"context_line":"            LOG.exception(exc)"},{"line_number":2864,"context_line":"            # ARQs created for instance or ports."},{"line_number":2865,"context_line":"            # The port binding isn\u0027t done yet."}],"source_content_type":"text/x-python","patch_set":20,"id":"e677d42b_08567134","line":2862,"in_reply_to":"c1a21d4b_06d12b6d","updated":"2025-07-23 13:17:02.000000000","message":"I replaced it with exception.InstanceEventTimeout, which is raised from wait_for_instance_event.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":false,"context_lines":[{"line_number":2859,"context_line":"                    arqs, requested_networks)"},{"line_number":2860,"context_line":"                LOG.debug(\"ARQs for spec:%s, ARQs for network:%s\","},{"line_number":2861,"context_line":"                    spec_arqs, network_arqs)"},{"line_number":2862,"context_line":"        except (Exception, eventlet.timeout.Timeout) as exc:"},{"line_number":2863,"context_line":"            LOG.exception(exc)"},{"line_number":2864,"context_line":"            # ARQs created for instance or ports."},{"line_number":2865,"context_line":"            # The port binding isn\u0027t done yet."}],"source_content_type":"text/x-python","patch_set":20,"id":"649a3a24_5b2ca400","line":2862,"in_reply_to":"e677d42b_08567134","updated":"2025-07-24 14:13:23.000000000","message":"Acknowledged","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":2999,"context_line":"                  for arq_uuid in arq_uuids]"},{"line_number":3000,"context_line":""},{"line_number":3001,"context_line":"        timeout \u003d CONF.arq_binding_timeout"},{"line_number":3002,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":3003,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":3004,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("},{"line_number":3005,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":20,"id":"0fc7aa8d_f7651f6d","line":3002,"updated":"2025-07-22 15:28:24.000000000","message":"It uses the same wait_for_instance_event that was transformed in this patch so we know that L2862 cannot get eventlet.timeout any more.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":false,"context_lines":[{"line_number":2999,"context_line":"                  for arq_uuid in arq_uuids]"},{"line_number":3000,"context_line":""},{"line_number":3001,"context_line":"        timeout \u003d CONF.arq_binding_timeout"},{"line_number":3002,"context_line":"        with self.virtapi.wait_for_instance_event("},{"line_number":3003,"context_line":"                instance, events, deadline\u003dtimeout):"},{"line_number":3004,"context_line":"            resolved_arqs \u003d cyclient.get_arqs_for_instance("},{"line_number":3005,"context_line":"                    instance.uuid, only_resolved\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":20,"id":"b8287515_609ac809","line":3002,"in_reply_to":"0fc7aa8d_f7651f6d","updated":"2025-07-24 14:13:23.000000000","message":"Acknowledged","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":9571,"context_line":"                self._cleanup_pre_live_migration("},{"line_number":9572,"context_line":"                    context, dest, instance, migration, migrate_data,"},{"line_number":9573,"context_line":"                    source_bdms)"},{"line_number":9574,"context_line":"        except eventlet.timeout.Timeout:"},{"line_number":9575,"context_line":"            # We only get here if wait_for_vif_plugged is True which means"},{"line_number":9576,"context_line":"            # live_migration_wait_for_vif_plug\u003dTrue on the destination host."},{"line_number":9577,"context_line":"            msg \u003d ("}],"source_content_type":"text/x-python","patch_set":20,"id":"7b725b8c_fd0fc203","line":9574,"updated":"2025-07-22 15:28:24.000000000","message":"This is also a usage a bit different than calling _get_bound_arq_resources. But if we can trust the comment below then this is also only due to calling wait_for_instance_event at L9544 which we changed not to raise this exception type but a new one.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":false,"context_lines":[{"line_number":9571,"context_line":"                self._cleanup_pre_live_migration("},{"line_number":9572,"context_line":"                    context, dest, instance, migration, migrate_data,"},{"line_number":9573,"context_line":"                    source_bdms)"},{"line_number":9574,"context_line":"        except eventlet.timeout.Timeout:"},{"line_number":9575,"context_line":"            # We only get here if wait_for_vif_plugged is True which means"},{"line_number":9576,"context_line":"            # live_migration_wait_for_vif_plug\u003dTrue on the destination host."},{"line_number":9577,"context_line":"            msg \u003d ("}],"source_content_type":"text/x-python","patch_set":20,"id":"de94c8d8_14727aa4","line":9574,"in_reply_to":"7b725b8c_fd0fc203","updated":"2025-07-24 14:13:23.000000000","message":"Acknowledged","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55307bbda786828cc9ada32a4a79624556ba62f6","unresolved":true,"context_lines":[{"line_number":487,"context_line":"        error_callback: ty.Callable,"},{"line_number":488,"context_line":"        deadline,"},{"line_number":489,"context_line":"    ) -\u003e None:"},{"line_number":490,"context_line":"        end_time \u003d time.monotonic() + deadline"},{"line_number":491,"context_line":"        for event_name, event in events.items():"},{"line_number":492,"context_line":"            if event.is_received_early():"},{"line_number":493,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f839a97_12461ded","line":490,"updated":"2025-07-24 14:26:48.000000000","message":"It\u0027s unfortunate that some bozo (me) mixed the terms \"timeout\" and \"deadline\" meaning the same thing. I think \"deadline\" should mean what you have here as \"end_time\", i.e. \"the time at which we must be finished\" and \"timeout\" should be \"how many seconds we\u0027re willing to wait, total\".\n\nYour (correct, AFAICT) refactoring here seems to make my prior sins look worse and more confusing, so it might be worth a revisit later to clean up the terminology.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":true,"context_lines":[{"line_number":487,"context_line":"        error_callback: ty.Callable,"},{"line_number":488,"context_line":"        deadline,"},{"line_number":489,"context_line":"    ) -\u003e None:"},{"line_number":490,"context_line":"        end_time \u003d time.monotonic() + deadline"},{"line_number":491,"context_line":"        for event_name, event in events.items():"},{"line_number":492,"context_line":"            if event.is_received_early():"},{"line_number":493,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":22,"id":"a63ad1d8_102a76e6","line":490,"in_reply_to":"5f839a97_12461ded","updated":"2025-07-25 08:44:41.000000000","message":"Ack, I\u0027ll rename it then and prepare a follow-up to change deadline to timeout in wait_for_instance_event","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ebc014cc02e9e213329facdad2baab525a689c6b","unresolved":true,"context_lines":[{"line_number":492,"context_line":"            if event.is_received_early():"},{"line_number":493,"context_line":"                continue"},{"line_number":494,"context_line":"            remaining_time \u003d deadline - time.monotonic()"},{"line_number":495,"context_line":"            if remaining_time \u003c\u003d 0:"},{"line_number":496,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":497,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":498,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"}],"source_content_type":"text/x-python","patch_set":23,"id":"3380975e_3094306d","line":495,"updated":"2025-07-25 15:09:34.000000000","message":"The coverage data shows we have no test for this timeout...I think maybe because our timeout tests are all mocking out the wait context manager.\n\nCould we add another thing maybe to test this staticmethod in isolation?","commit_id":"c4583e5d5957e66e9ab5109513ac5bf087e1edec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a7113eca1275e54868252c6ee09a23fe5c49d212","unresolved":true,"context_lines":[{"line_number":492,"context_line":"            if event.is_received_early():"},{"line_number":493,"context_line":"                continue"},{"line_number":494,"context_line":"            remaining_time \u003d deadline - time.monotonic()"},{"line_number":495,"context_line":"            if remaining_time \u003c\u003d 0:"},{"line_number":496,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":497,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":498,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"}],"source_content_type":"text/x-python","patch_set":23,"id":"62c42b7e_7b276453","line":495,"in_reply_to":"3380975e_3094306d","updated":"2025-07-29 12:31:00.000000000","message":"@ksambor@redhat.com Thanks for adding TestWaitForInstanceEvents. As far as I see this still not triggers this code path. (At least if I inject an error and run the new tests they are not failing.","commit_id":"c4583e5d5957e66e9ab5109513ac5bf087e1edec"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2722b188c8d4564fee5ba288f20b08d27a745810","unresolved":false,"context_lines":[{"line_number":492,"context_line":"            if event.is_received_early():"},{"line_number":493,"context_line":"                continue"},{"line_number":494,"context_line":"            remaining_time \u003d deadline - time.monotonic()"},{"line_number":495,"context_line":"            if remaining_time \u003c\u003d 0:"},{"line_number":496,"context_line":"                raise exception.InstanceEventTimeout()"},{"line_number":497,"context_line":"            actual_event \u003d event.wait(timeout\u003dremaining_time)"},{"line_number":498,"context_line":"            if actual_event.status \u003d\u003d \u0027completed\u0027:"}],"source_content_type":"text/x-python","patch_set":23,"id":"0c2c36d9_18c6a211","line":495,"in_reply_to":"62c42b7e_7b276453","updated":"2025-07-29 13:28:18.000000000","message":"Done","commit_id":"c4583e5d5957e66e9ab5109513ac5bf087e1edec"}],"nova/exception.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55307bbda786828cc9ada32a4a79624556ba62f6","unresolved":true,"context_lines":[{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"class InstanceEventTimeout(Exception):"},{"line_number":2667,"context_line":"    \"\"\"A custom timeout exception to replace eventlet.timeout.Timeout.\"\"\""},{"line_number":2668,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":22,"id":"a3eff722_cc1a6066","line":2668,"updated":"2025-07-24 14:26:48.000000000","message":"This isn\u0027t used outside of the compute manager (AFAICT) and is really just for internal signaling, so I\u0027d propose we move this back over there, near the other private sentinels, classes, event implementation, etc.\n\n(maybe, see comment in `libvirt/driver.py`)","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a817fb6b5f1f12e5f1e77e4313b2f6c6d594488","unresolved":true,"context_lines":[{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"class InstanceEventTimeout(Exception):"},{"line_number":2667,"context_line":"    \"\"\"A custom timeout exception to replace eventlet.timeout.Timeout.\"\"\""},{"line_number":2668,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":22,"id":"54c0c137_31f4fcf7","line":2668,"in_reply_to":"5a726ec3_5efd01ec","updated":"2025-07-25 15:01:03.000000000","message":"Could put it inside VirtAPI itself, but since it\u0027s actually used in both places (virt and compute) it\u0027s less meaningful to move it out of here.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":true,"context_lines":[{"line_number":2665,"context_line":""},{"line_number":2666,"context_line":"class InstanceEventTimeout(Exception):"},{"line_number":2667,"context_line":"    \"\"\"A custom timeout exception to replace eventlet.timeout.Timeout.\"\"\""},{"line_number":2668,"context_line":"    pass"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a726ec3_5efd01ec","line":2668,"in_reply_to":"a3eff722_cc1a6066","updated":"2025-07-25 08:44:41.000000000","message":"Sure, I can. I just wasn\u0027t sure where to put it at first, so I initially placed it near the event implementation. But when @gibi mentioned a more general place for the exception, I thought it was a good idea to move the error there.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":true,"context_lines":[{"line_number":5558,"context_line":"                                                  tag\u003dNone)"},{"line_number":5559,"context_line":"        self.compute._process_instance_event(inst_obj, event_obj)"},{"line_number":5560,"context_line":"        self.assertTrue(event.ready())"},{"line_number":5561,"context_line":"        self.assertEqual(event_obj, event.wait())"},{"line_number":5562,"context_line":"        self.assertEqual({}, self.compute.instance_events._events)"},{"line_number":5563,"context_line":""},{"line_number":5564,"context_line":"    @ddt.data(task_states.DELETING,"}],"source_content_type":"text/x-python","patch_set":16,"id":"ae0ecbdb_9254dcbb","side":"PARENT","line":5561,"updated":"2025-07-04 13:29:10.000000000","message":"why we dropped this. I think this still should pass as our construct supports sending the data through the ThreadingEvent","commit_id":"5c180e17611f24b6eb14900b5170bed8df18b5fb"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fc5471b9ab2af58871ead83bfae670dc09c01a26","unresolved":false,"context_lines":[{"line_number":5558,"context_line":"                                                  tag\u003dNone)"},{"line_number":5559,"context_line":"        self.compute._process_instance_event(inst_obj, event_obj)"},{"line_number":5560,"context_line":"        self.assertTrue(event.ready())"},{"line_number":5561,"context_line":"        self.assertEqual(event_obj, event.wait())"},{"line_number":5562,"context_line":"        self.assertEqual({}, self.compute.instance_events._events)"},{"line_number":5563,"context_line":""},{"line_number":5564,"context_line":"    @ddt.data(task_states.DELETING,"}],"source_content_type":"text/x-python","patch_set":16,"id":"6ca279a1_e8d6a5a7","side":"PARENT","line":5561,"in_reply_to":"ae0ecbdb_9254dcbb","updated":"2025-07-07 14:44:08.000000000","message":"Done","commit_id":"5c180e17611f24b6eb14900b5170bed8df18b5fb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":true,"context_lines":[{"line_number":6037,"context_line":"        event \u003d fake_eventlet_event.send.call_args_list[0][0][0]"},{"line_number":6038,"context_line":"        self.assertEqual(\u0027network-vif-plugged\u0027, event.name)"},{"line_number":6039,"context_line":"        self.assertEqual(uuids.portid, event.tag)"},{"line_number":6040,"context_line":"        self.assertEqual(\u0027failed\u0027, event.status)"},{"line_number":6041,"context_line":""},{"line_number":6042,"context_line":"    def test_cleanup_cancels_all_events(self):"},{"line_number":6043,"context_line":"        with mock.patch.object(self.compute, \u0027instance_events\u0027) as mock_ev:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a1a2dd3_45bf28c9","side":"PARENT","line":6040,"updated":"2025-07-04 13:29:10.000000000","message":"ditto I think we still support sending the data through so we should be able to keep this assert","commit_id":"5c180e17611f24b6eb14900b5170bed8df18b5fb"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fc5471b9ab2af58871ead83bfae670dc09c01a26","unresolved":false,"context_lines":[{"line_number":6037,"context_line":"        event \u003d fake_eventlet_event.send.call_args_list[0][0][0]"},{"line_number":6038,"context_line":"        self.assertEqual(\u0027network-vif-plugged\u0027, event.name)"},{"line_number":6039,"context_line":"        self.assertEqual(uuids.portid, event.tag)"},{"line_number":6040,"context_line":"        self.assertEqual(\u0027failed\u0027, event.status)"},{"line_number":6041,"context_line":""},{"line_number":6042,"context_line":"    def test_cleanup_cancels_all_events(self):"},{"line_number":6043,"context_line":"        with mock.patch.object(self.compute, \u0027instance_events\u0027) as mock_ev:"}],"source_content_type":"text/x-python","patch_set":16,"id":"16d8c38d_0233d4c0","side":"PARENT","line":6040,"in_reply_to":"3a1a2dd3_45bf28c9","updated":"2025-07-07 14:44:08.000000000","message":"Done","commit_id":"5c180e17611f24b6eb14900b5170bed8df18b5fb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"8fb93799c79b250a3113b012797849ad324ec72d","unresolved":true,"context_lines":[{"line_number":15115,"context_line":""},{"line_number":15116,"context_line":""},{"line_number":15117,"context_line":"class ThreadingEventWithResultTestCase(test.NoDBTestCase):"},{"line_number":15118,"context_line":"    \"\"\"Test case for ThreadingEventWithResult class.\"\"\""},{"line_number":15119,"context_line":""},{"line_number":15120,"context_line":"    def test_init(self):"},{"line_number":15121,"context_line":"        event \u003d manager.ThreadingEventWithResult()"}],"source_content_type":"text/x-python","patch_set":17,"id":"cc9b1280_037f8a5d","line":15118,"updated":"2025-07-08 13:19:04.000000000","message":"+1 for covering this properly.","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":15115,"context_line":""},{"line_number":15116,"context_line":""},{"line_number":15117,"context_line":"class ThreadingEventWithResultTestCase(test.NoDBTestCase):"},{"line_number":15118,"context_line":"    \"\"\"Test case for ThreadingEventWithResult class.\"\"\""},{"line_number":15119,"context_line":""},{"line_number":15120,"context_line":"    def test_init(self):"},{"line_number":15121,"context_line":"        event \u003d manager.ThreadingEventWithResult()"}],"source_content_type":"text/x-python","patch_set":17,"id":"c693e5f1_58eb6d8f","line":15118,"in_reply_to":"cc9b1280_037f8a5d","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"68eb3bc40517f8aea3b61727668c023c77e0e0ae"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":23,"context_line":"from cinderclient import exceptions as cinder_exception"},{"line_number":24,"context_line":"from cursive import exception as cursive_exception"},{"line_number":25,"context_line":"import ddt"},{"line_number":26,"context_line":"from eventlet import timeout as eventlet_timeout"},{"line_number":27,"context_line":"from keystoneauth1 import exceptions as keystone_exception"},{"line_number":28,"context_line":"import netaddr"},{"line_number":29,"context_line":"from openstack import exceptions as sdk_exc"}],"source_content_type":"text/x-python","patch_set":20,"id":"eb8615e6_06665987","line":26,"updated":"2025-07-22 15:28:24.000000000","message":"I think we can remove eventlet.timeout from compute/manager so we should be able to remove it from all the tests here.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from cinderclient import exceptions as cinder_exception"},{"line_number":24,"context_line":"from cursive import exception as cursive_exception"},{"line_number":25,"context_line":"import ddt"},{"line_number":26,"context_line":"from eventlet import timeout as eventlet_timeout"},{"line_number":27,"context_line":"from keystoneauth1 import exceptions as keystone_exception"},{"line_number":28,"context_line":"import netaddr"},{"line_number":29,"context_line":"from openstack import exceptions as sdk_exc"}],"source_content_type":"text/x-python","patch_set":20,"id":"c6b0628e_10f15f3e","line":26,"in_reply_to":"eb8615e6_06665987","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":5496,"context_line":""},{"line_number":5497,"context_line":"    @mock.patch(\u0027nova.compute.manager.InstanceEvents._lock_name\u0027)"},{"line_number":5498,"context_line":"    def test_pop_instance_event(self, lock_name_mock):"},{"line_number":5499,"context_line":"        event \u003d threading.Event()"},{"line_number":5500,"context_line":"        self.compute.instance_events._events \u003d {"},{"line_number":5501,"context_line":"            uuids.instance: {"},{"line_number":5502,"context_line":"                (\u0027network-vif-plugged\u0027, None): event,"}],"source_content_type":"text/x-python","patch_set":20,"id":"51f104f8_28ee5fc3","line":5499,"updated":"2025-07-22 15:28:24.000000000","message":"here and below in similar test cases: I\u0027m wondering if this would be more realistic using our new ThreadinEventWithResult","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":5496,"context_line":""},{"line_number":5497,"context_line":"    @mock.patch(\u0027nova.compute.manager.InstanceEvents._lock_name\u0027)"},{"line_number":5498,"context_line":"    def test_pop_instance_event(self, lock_name_mock):"},{"line_number":5499,"context_line":"        event \u003d threading.Event()"},{"line_number":5500,"context_line":"        self.compute.instance_events._events \u003d {"},{"line_number":5501,"context_line":"            uuids.instance: {"},{"line_number":5502,"context_line":"                (\u0027network-vif-plugged\u0027, None): event,"}],"source_content_type":"text/x-python","patch_set":20,"id":"5c1def66_7b8a1df6","line":5499,"in_reply_to":"51f104f8_28ee5fc3","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":false,"context_lines":[{"line_number":15187,"context_line":"        waiter_thread \u003d threading.Thread(target\u003d_wait_for_event)"},{"line_number":15188,"context_line":"        waiter_thread.start()"},{"line_number":15189,"context_line":""},{"line_number":15190,"context_line":"        # Give the waiter thread a moment to start and block on wait()"},{"line_number":15191,"context_line":"        time.sleep(0.05)"},{"line_number":15192,"context_line":"        self.assertTrue(waiter_thread.is_alive())"},{"line_number":15193,"context_line":"        self.assertFalse(event.is_set())"},{"line_number":15194,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"21cfc07c_553c8921","line":15191,"range":{"start_line":15190,"start_character":1,"end_line":15191,"end_character":24},"updated":"2025-07-22 15:28:24.000000000","message":"These are tend to be flaky tests in a busy CI. \n\n// later\n\nOK it is not flaky as the test is not asserting any consequence of the actual sleep. It is impossible to tell if the _wait_for_event thread already waiting or just started Thread.run() (and therefore is_alive is True) but context switched away before reaching event.wait()\n\nI\u0027m not really motivated to try to test the behavior so deeply to try to only set the event after we know the other thread started waiting. But meh.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":15197,"context_line":""},{"line_number":15198,"context_line":"        # The waiter thread should finish promptly"},{"line_number":15199,"context_line":"        waiter_thread.join(timeout\u003d1)"},{"line_number":15200,"context_line":"        self.assertFalse("},{"line_number":15201,"context_line":"    waiter_thread.is_alive(),"},{"line_number":15202,"context_line":"     \"Waiter thread should have finished.\")"},{"line_number":15203,"context_line":""},{"line_number":15204,"context_line":"        # Verify the result was received correctly"},{"line_number":15205,"context_line":"        self.assertEqual(len(result_from_thread), 1)"}],"source_content_type":"text/x-python","patch_set":20,"id":"a512cd09_0a3eeb5e","line":15202,"range":{"start_line":15200,"start_character":0,"end_line":15202,"end_character":43},"updated":"2025-07-22 15:28:24.000000000","message":"The line split seems strange here and below in couple of places.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":15197,"context_line":""},{"line_number":15198,"context_line":"        # The waiter thread should finish promptly"},{"line_number":15199,"context_line":"        waiter_thread.join(timeout\u003d1)"},{"line_number":15200,"context_line":"        self.assertFalse("},{"line_number":15201,"context_line":"    waiter_thread.is_alive(),"},{"line_number":15202,"context_line":"     \"Waiter thread should have finished.\")"},{"line_number":15203,"context_line":""},{"line_number":15204,"context_line":"        # Verify the result was received correctly"},{"line_number":15205,"context_line":"        self.assertEqual(len(result_from_thread), 1)"}],"source_content_type":"text/x-python","patch_set":20,"id":"9b3107ed_0ee17382","line":15202,"range":{"start_line":15200,"start_character":0,"end_line":15202,"end_character":43},"in_reply_to":"a512cd09_0a3eeb5e","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":15204,"context_line":"        # Verify the result was received correctly"},{"line_number":15205,"context_line":"        self.assertEqual(len(result_from_thread), 1)"},{"line_number":15206,"context_line":"        self.assertEqual(result_from_thread[0], expected_result)"},{"line_number":15207,"context_line":"        self.assertEqual(event.result, expected_result)"},{"line_number":15208,"context_line":""},{"line_number":15209,"context_line":"    def test_set_race_condition(self):"},{"line_number":15210,"context_line":"        event \u003d manager.ThreadingEventWithResult()"}],"source_content_type":"text/x-python","patch_set":20,"id":"37a85758_6c6965a3","line":15207,"updated":"2025-07-22 15:28:24.000000000","message":"I would not look inside the event class with event.result. We can even make that field \"private\" by renaming it to _result","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":15204,"context_line":"        # Verify the result was received correctly"},{"line_number":15205,"context_line":"        self.assertEqual(len(result_from_thread), 1)"},{"line_number":15206,"context_line":"        self.assertEqual(result_from_thread[0], expected_result)"},{"line_number":15207,"context_line":"        self.assertEqual(event.result, expected_result)"},{"line_number":15208,"context_line":""},{"line_number":15209,"context_line":"    def test_set_race_condition(self):"},{"line_number":15210,"context_line":"        event \u003d manager.ThreadingEventWithResult()"}],"source_content_type":"text/x-python","patch_set":20,"id":"6957092a_1ec0f456","line":15207,"in_reply_to":"37a85758_6c6965a3","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":15236,"context_line":""},{"line_number":15237,"context_line":"        # Wait for all threads to complete"},{"line_number":15238,"context_line":"        for thread in threads:"},{"line_number":15239,"context_line":"            thread.join(timeout\u003d2)"},{"line_number":15240,"context_line":""},{"line_number":15241,"context_line":"        # 1. Verify that the event was ultimately set"},{"line_number":15242,"context_line":"        self.assertTrue(event.is_set())"}],"source_content_type":"text/x-python","patch_set":20,"id":"0f423761_699577e3","line":15239,"updated":"2025-07-22 15:28:24.000000000","message":"you can use join without timeout then we don\u0027t have to adjust this timeout value in a busy CI machine.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":15236,"context_line":""},{"line_number":15237,"context_line":"        # Wait for all threads to complete"},{"line_number":15238,"context_line":"        for thread in threads:"},{"line_number":15239,"context_line":"            thread.join(timeout\u003d2)"},{"line_number":15240,"context_line":""},{"line_number":15241,"context_line":"        # 1. Verify that the event was ultimately set"},{"line_number":15242,"context_line":"        self.assertTrue(event.is_set())"}],"source_content_type":"text/x-python","patch_set":20,"id":"20528d5e_a959d9c5","line":15239,"in_reply_to":"0f423761_699577e3","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"bd590f8965d604ca693c523a2ca9352212dc3167","unresolved":true,"context_lines":[{"line_number":15258,"context_line":"    1,"},{"line_number":15259,"context_line":"    f\"Expected {"},{"line_number":15260,"context_line":"        num_threads -"},{"line_number":15261,"context_line":"         1} failures.\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"b3643fbf_1ce1b48a","line":15261,"updated":"2025-07-22 15:28:24.000000000","message":"```\n    f\"Expected {\n    ^\nSyntaxError: unterminated string literal (detected at line 15259)\n```\n\nI think fstring support evolved over time and in py310 we have limitations about\nsplitting an expression within the fstring over multiple lines.","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":15258,"context_line":"    1,"},{"line_number":15259,"context_line":"    f\"Expected {"},{"line_number":15260,"context_line":"        num_threads -"},{"line_number":15261,"context_line":"         1} failures.\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"37012033_4bfb396d","line":15261,"in_reply_to":"b3643fbf_1ce1b48a","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":true,"context_lines":[{"line_number":15221,"context_line":"            except ValueError:"},{"line_number":15222,"context_line":"                outcomes.append(\"failure\")"},{"line_number":15223,"context_line":"            except Exception as e:"},{"line_number":15224,"context_line":"                outcomes.append(e)"},{"line_number":15225,"context_line":"        threads \u003d []"},{"line_number":15226,"context_line":"        possible_results \u003d ["},{"line_number":15227,"context_line":"            f\"result_from_thread_{i}\" for i in range(num_threads)]"},{"line_number":15228,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"4428a7c8_ba7af8e2","line":15225,"range":{"start_line":15224,"start_character":0,"end_line":15225,"end_character":20},"updated":"2025-07-24 14:13:23.000000000","message":"nit: I would put a new line after the end of the inline func def to help the readability.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":false,"context_lines":[{"line_number":15221,"context_line":"            except ValueError:"},{"line_number":15222,"context_line":"                outcomes.append(\"failure\")"},{"line_number":15223,"context_line":"            except Exception as e:"},{"line_number":15224,"context_line":"                outcomes.append(e)"},{"line_number":15225,"context_line":"        threads \u003d []"},{"line_number":15226,"context_line":"        possible_results \u003d ["},{"line_number":15227,"context_line":"            f\"result_from_thread_{i}\" for i in range(num_threads)]"},{"line_number":15228,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"4693db12_5864aa53","line":15225,"range":{"start_line":15224,"start_character":0,"end_line":15225,"end_character":20},"in_reply_to":"4428a7c8_ba7af8e2","updated":"2025-07-25 08:44:41.000000000","message":"Done","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a7113eca1275e54868252c6ee09a23fe5c49d212","unresolved":true,"context_lines":[{"line_number":15303,"context_line":"        self.event3 \u003d mock.Mock()"},{"line_number":15304,"context_line":"        self.event3.is_received_early.return_value \u003d False"},{"line_number":15305,"context_line":"        self.event3.wait.return_value \u003d mock.Mock(status\u003d\u0027completed\u0027)"},{"line_number":15306,"context_line":"        events \u003d {"},{"line_number":15307,"context_line":"    \u0027event1\u0027: self.event1,"},{"line_number":15308,"context_line":"    \u0027event2\u0027: self.event2,"},{"line_number":15309,"context_line":"     \u0027event3\u0027: self.event3}"},{"line_number":15310,"context_line":"        manager.ComputeVirtAPI._wait_for_instance_events("},{"line_number":15311,"context_line":"            self.instance, events, self.error_callback, self.timeout)"},{"line_number":15312,"context_line":"        self.event1.wait.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":24,"id":"57b784dc_7d41678c","line":15309,"range":{"start_line":15306,"start_character":0,"end_line":15309,"end_character":27},"updated":"2025-07-29 12:31:00.000000000","message":"this is formatted in a strange way. I suggest:\n```\n        events \u003d {\n            \u0027event1\u0027: self.event1,\n            \u0027event2\u0027: self.event2,\n            \u0027event3\u0027: self.event3,\n        }\n```","commit_id":"92c027762d6e87cdfb8ab64a7bc6b0ed6fb341d5"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2722b188c8d4564fee5ba288f20b08d27a745810","unresolved":false,"context_lines":[{"line_number":15303,"context_line":"        self.event3 \u003d mock.Mock()"},{"line_number":15304,"context_line":"        self.event3.is_received_early.return_value \u003d False"},{"line_number":15305,"context_line":"        self.event3.wait.return_value \u003d mock.Mock(status\u003d\u0027completed\u0027)"},{"line_number":15306,"context_line":"        events \u003d {"},{"line_number":15307,"context_line":"    \u0027event1\u0027: self.event1,"},{"line_number":15308,"context_line":"    \u0027event2\u0027: self.event2,"},{"line_number":15309,"context_line":"     \u0027event3\u0027: self.event3}"},{"line_number":15310,"context_line":"        manager.ComputeVirtAPI._wait_for_instance_events("},{"line_number":15311,"context_line":"            self.instance, events, self.error_callback, self.timeout)"},{"line_number":15312,"context_line":"        self.event1.wait.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a0e99ca_99948774","line":15309,"range":{"start_line":15306,"start_character":0,"end_line":15309,"end_character":27},"in_reply_to":"57b784dc_7d41678c","updated":"2025-07-29 13:28:18.000000000","message":"Done","commit_id":"92c027762d6e87cdfb8ab64a7bc6b0ed6fb341d5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8e723bddfc49b05aa5f1a5bf3d0a9880bbcbc592","unresolved":false,"context_lines":[{"line_number":15308,"context_line":"                    self.instance, events, self.error_callback, self.timeout)"},{"line_number":15309,"context_line":""},{"line_number":15310,"context_line":"        self.event1.wait.assert_not_called()"},{"line_number":15311,"context_line":""},{"line_number":15312,"context_line":"    def test_multiple_events_some_early_some_completed(self):"},{"line_number":15313,"context_line":"        self.event1.is_received_early.return_value \u003d True"},{"line_number":15314,"context_line":"        self.event2.is_received_early.return_value \u003d False"}],"source_content_type":"text/x-python","patch_set":25,"id":"fb3b245c_241900dd","line":15311,"updated":"2025-07-29 14:31:09.000000000","message":"OK so timeout is 1 and monotonic returns 100 and 101. So before we call event1.wait it is already 101 so the remaining time is 0.","commit_id":"48ddc7c4d13028a0ebcbabfa75a19828129d0d0b"}],"nova/tests/unit/compute/test_virtapi.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":16,"id":"5ab5105d_390681b8","updated":"2025-07-04 13:29:10.000000000","message":"The changes in these tests suggest me that something is wrong with the implementation around the timed out case","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2722b188c8d4564fee5ba288f20b08d27a745810","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"07517ff4_9dbb3612","in_reply_to":"1574b4e8_3f827405","updated":"2025-07-29 13:28:18.000000000","message":"Done","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a7113eca1275e54868252c6ee09a23fe5c49d212","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"200fbee6_79bfacee","in_reply_to":"1574b4e8_3f827405","updated":"2025-07-29 12:31:00.000000000","message":"Done","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fc5471b9ab2af58871ead83bfae670dc09c01a26","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":16,"id":"1574b4e8_3f827405","in_reply_to":"5ab5105d_390681b8","updated":"2025-07-07 14:44:08.000000000","message":"Imo problem was with test because we never have path to raise eventlet.timeout.Timeout from event lvl (we didn\u0027t pass any timeout to eventlet event) and we always timeout on context manager lvl https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L559","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"601b3472f7886ac3cae7ef315479a3b3a92674d9","unresolved":true,"context_lines":[{"line_number":214,"context_line":"                \u0027vm_state\u0027: mock.sentinel.vm_state,"},{"line_number":215,"context_line":"                \u0027task_state\u0027: mock.sentinel.task_state,"},{"line_number":216,"context_line":"                \u0027event_states\u0027:"},{"line_number":217,"context_line":"                    \u0027foo-bar: waiting\u0027,"},{"line_number":218,"context_line":"            },"},{"line_number":219,"context_line":"            instance\u003dinstance"},{"line_number":220,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":20,"id":"4a759198_539c9fee","line":217,"updated":"2025-07-22 15:57:38.000000000","message":"You can trigger the original time out behavior by ensuring that the event.wait() returns ThreadingEventWithResult.FAILED_SENTINEL\n\n```\ndiff --git a/nova/tests/unit/compute/test_virtapi.py b/nova/tests/unit/compute/test_virtapi.py\nindex 9121cdc033..c1cf0bf381 100644\n--- a/nova/tests/unit/compute/test_virtapi.py\n+++ b/nova/tests/unit/compute/test_virtapi.py\n@@ -198,7 +198,7 @@ class ComputeVirtAPITest(VirtAPIBaseTest):\n \n         @mock.patch.object(compute_manager, \u0027LOG\u0027, new\u003dmock_log)\n         @mock.patch.object(self.virtapi._compute, \u0027_event_waiter\u0027,\n-                           side_effect\u003dexception.InstanceEventTimeout())\n+                           return_value\u003dcompute_manager.ThreadingEventWithResult.FAILED_SENTINEL)\n         def do_test(mock_waiter):\n             with self.virtapi.wait_for_instance_event(\n                     instance, [(\u0027foo\u0027, \u0027bar\u0027)]):\n@@ -214,7 +214,7 @@ class ComputeVirtAPITest(VirtAPIBaseTest):\n                 \u0027vm_state\u0027: mock.sentinel.vm_state,\n                 \u0027task_state\u0027: mock.sentinel.task_state,\n                 \u0027event_states\u0027:\n-                    \u0027foo-bar: waiting\u0027,\n+                    \u0027foo-bar: timed out after 1.23 seconds\u0027,\n             },\n             instance\u003dinstance\n         )\n\n```","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"8df3af215eb87cd760b818bb2a36eb5633d48beb","unresolved":false,"context_lines":[{"line_number":214,"context_line":"                \u0027vm_state\u0027: mock.sentinel.vm_state,"},{"line_number":215,"context_line":"                \u0027task_state\u0027: mock.sentinel.task_state,"},{"line_number":216,"context_line":"                \u0027event_states\u0027:"},{"line_number":217,"context_line":"                    \u0027foo-bar: waiting\u0027,"},{"line_number":218,"context_line":"            },"},{"line_number":219,"context_line":"            instance\u003dinstance"},{"line_number":220,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":20,"id":"4d445e79_e46196ff","line":217,"in_reply_to":"4a759198_539c9fee","updated":"2025-07-23 13:17:02.000000000","message":"Done","commit_id":"9c5d4c6a4669491c7095084f003c05c3a6b89d6e"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":true,"context_lines":[{"line_number":261,"context_line":"                \u0027task_state\u0027: mock.sentinel.task_state,"},{"line_number":262,"context_line":"                \u0027event_states\u0027:"},{"line_number":263,"context_line":"                    \u0027foo-bar: received after waiting 1.23 seconds, \u0027"},{"line_number":264,"context_line":"                    \u0027missing-event: waiting\u0027,"},{"line_number":265,"context_line":"            },"},{"line_number":266,"context_line":"            instance\u003dinstance"},{"line_number":267,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":22,"id":"dce56483_0194aa59","line":264,"updated":"2025-07-24 14:13:23.000000000","message":"you need to apply the similar pattern than above to trigger the timed out scenario. (i.e. you need to return FAILED_SENTINEL)","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                \u0027task_state\u0027: mock.sentinel.task_state,"},{"line_number":262,"context_line":"                \u0027event_states\u0027:"},{"line_number":263,"context_line":"                    \u0027foo-bar: received after waiting 1.23 seconds, \u0027"},{"line_number":264,"context_line":"                    \u0027missing-event: waiting\u0027,"},{"line_number":265,"context_line":"            },"},{"line_number":266,"context_line":"            instance\u003dinstance"},{"line_number":267,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":22,"id":"e4e97fba_8537bcb8","line":264,"in_reply_to":"dce56483_0194aa59","updated":"2025-07-25 08:44:41.000000000","message":"Done","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":true,"context_lines":[{"line_number":335,"context_line":"                \u0027event_states\u0027:"},{"line_number":336,"context_line":"                    \u0027received-event: received after waiting 1.23 seconds, \u0027"},{"line_number":337,"context_line":"                    \u0027early-event: received early, \u0027"},{"line_number":338,"context_line":"                    \u0027missing-event: waiting, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not \u0027"}],"source_content_type":"text/x-python","patch_set":22,"id":"7d8f6f10_71106122","line":338,"updated":"2025-07-24 14:13:23.000000000","message":"ditto","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                \u0027event_states\u0027:"},{"line_number":336,"context_line":"                    \u0027received-event: received after waiting 1.23 seconds, \u0027"},{"line_number":337,"context_line":"                    \u0027early-event: received early, \u0027"},{"line_number":338,"context_line":"                    \u0027missing-event: waiting, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not \u0027"}],"source_content_type":"text/x-python","patch_set":22,"id":"ad8fbeb4_ac2c67c9","line":338,"in_reply_to":"7d8f6f10_71106122","updated":"2025-07-25 08:44:41.000000000","message":"Done","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"72f88f29cb1e5f30e6da846a22207accfe27e60c","unresolved":true,"context_lines":[{"line_number":338,"context_line":"                    \u0027missing-event: waiting, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not \u0027"},{"line_number":342,"context_line":"                    \u0027processed\u0027"},{"line_number":343,"context_line":"            },"},{"line_number":344,"context_line":"            instance\u003dinstance"}],"source_content_type":"text/x-python","patch_set":22,"id":"4e0f76aa_1691f1a6","line":341,"updated":"2025-07-24 14:13:23.000000000","message":"probably ditto","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":false,"context_lines":[{"line_number":338,"context_line":"                    \u0027missing-event: waiting, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not \u0027"},{"line_number":342,"context_line":"                    \u0027processed\u0027"},{"line_number":343,"context_line":"            },"},{"line_number":344,"context_line":"            instance\u003dinstance"}],"source_content_type":"text/x-python","patch_set":22,"id":"7c8282a9_06df518e","line":341,"in_reply_to":"4e0f76aa_1691f1a6","updated":"2025-07-25 08:44:41.000000000","message":"Done","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2c4abcf714d5749904de7820561155de1db8c913","unresolved":true,"context_lines":[{"line_number":338,"context_line":"                    \u0027missing-event: timed out after 1.23 seconds, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not processed\u0027"},{"line_number":342,"context_line":"            },"},{"line_number":343,"context_line":"            instance\u003dinstance"},{"line_number":344,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":23,"id":"41408116_2d99ffcd","line":341,"updated":"2025-07-28 13:36:04.000000000","message":"the expected result should not change","commit_id":"c4583e5d5957e66e9ab5109513ac5bf087e1edec"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"2722b188c8d4564fee5ba288f20b08d27a745810","unresolved":false,"context_lines":[{"line_number":338,"context_line":"                    \u0027missing-event: timed out after 1.23 seconds, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not processed\u0027"},{"line_number":342,"context_line":"            },"},{"line_number":343,"context_line":"            instance\u003dinstance"},{"line_number":344,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":23,"id":"7af53649_eb71e49a","line":341,"in_reply_to":"41408116_2d99ffcd","updated":"2025-07-29 13:28:18.000000000","message":"Done","commit_id":"c4583e5d5957e66e9ab5109513ac5bf087e1edec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a7113eca1275e54868252c6ee09a23fe5c49d212","unresolved":false,"context_lines":[{"line_number":338,"context_line":"                    \u0027missing-event: timed out after 1.23 seconds, \u0027"},{"line_number":339,"context_line":"                    \u0027received-but-not-waited-event: received but not \u0027"},{"line_number":340,"context_line":"                    \u0027processed, \u0027"},{"line_number":341,"context_line":"                    \u0027missing-but-not-waited-event: received but not processed\u0027"},{"line_number":342,"context_line":"            },"},{"line_number":343,"context_line":"            instance\u003dinstance"},{"line_number":344,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":23,"id":"aa3e1c13_a3c6f087","line":341,"in_reply_to":"41408116_2d99ffcd","updated":"2025-07-29 12:31:00.000000000","message":"thanks!","commit_id":"c4583e5d5957e66e9ab5109513ac5bf087e1edec"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2bbb15aad049d08f15fb6b070c29bca676182654","unresolved":true,"context_lines":[{"line_number":14839,"context_line":"        mock_copy_disk_path.assert_called_once_with(self.context, instance,"},{"line_number":14840,"context_line":"                                                    guest)"},{"line_number":14841,"context_line":""},{"line_number":14842,"context_line":"        class AnyEventletEvent(object):"},{"line_number":14843,"context_line":"            def __eq__(self, other):"},{"line_number":14844,"context_line":"                return type(other) is threading.Event"},{"line_number":14845,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"4541bbbc_f282a0d0","line":14842,"updated":"2025-07-04 13:29:10.000000000","message":"I would rename this to AnyEvent","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"fc5471b9ab2af58871ead83bfae670dc09c01a26","unresolved":false,"context_lines":[{"line_number":14839,"context_line":"        mock_copy_disk_path.assert_called_once_with(self.context, instance,"},{"line_number":14840,"context_line":"                                                    guest)"},{"line_number":14841,"context_line":""},{"line_number":14842,"context_line":"        class AnyEventletEvent(object):"},{"line_number":14843,"context_line":"            def __eq__(self, other):"},{"line_number":14844,"context_line":"                return type(other) is threading.Event"},{"line_number":14845,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"2b865f41_7ea77ec5","line":14842,"in_reply_to":"4541bbbc_f282a0d0","updated":"2025-07-07 14:44:08.000000000","message":"Done","commit_id":"bfdd360fe87af0bf0ec930b0ebb50ab428c2ed0c"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"55307bbda786828cc9ada32a4a79624556ba62f6","unresolved":true,"context_lines":[{"line_number":8251,"context_line":"                        context, xml, instance,"},{"line_number":8252,"context_line":"                        pause\u003dpause, power_on\u003dpower_on,"},{"line_number":8253,"context_line":"                        post_xml_callback\u003dpost_xml_callback)"},{"line_number":8254,"context_line":"        except exception.InstanceEventTimeout:"},{"line_number":8255,"context_line":"            # We did not receive all expected events from Neutron, a warning"},{"line_number":8256,"context_line":"            # has already been logged by wait_for_instance_event, but we need"},{"line_number":8257,"context_line":"            # to decide if the issue is fatal."}],"source_content_type":"text/x-python","patch_set":22,"id":"3a5a2c44_aa10654c","line":8254,"updated":"2025-07-24 14:26:48.000000000","message":"Hmm, how can this happen? This looks like it ends up back inside compute manager, which is the only place we raise InstanceEventTimeout, right?","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"d79a35a37c0bb4e651901d48df7fdff764baaafc","unresolved":true,"context_lines":[{"line_number":8251,"context_line":"                        context, xml, instance,"},{"line_number":8252,"context_line":"                        pause\u003dpause, power_on\u003dpower_on,"},{"line_number":8253,"context_line":"                        post_xml_callback\u003dpost_xml_callback)"},{"line_number":8254,"context_line":"        except exception.InstanceEventTimeout:"},{"line_number":8255,"context_line":"            # We did not receive all expected events from Neutron, a warning"},{"line_number":8256,"context_line":"            # has already been logged by wait_for_instance_event, but we need"},{"line_number":8257,"context_line":"            # to decide if the issue is fatal."}],"source_content_type":"text/x-python","patch_set":22,"id":"b8acbaa7_1841ca58","line":8254,"in_reply_to":"3a5a2c44_aa10654c","updated":"2025-07-25 08:44:41.000000000","message":"I thought it was raised from ComputeVirtAPI.wait_for_instance_event in the manager.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8e1fe82d702a4fb7e6887be0dc9b221e40f138eb","unresolved":true,"context_lines":[{"line_number":8251,"context_line":"                        context, xml, instance,"},{"line_number":8252,"context_line":"                        pause\u003dpause, power_on\u003dpower_on,"},{"line_number":8253,"context_line":"                        post_xml_callback\u003dpost_xml_callback)"},{"line_number":8254,"context_line":"        except exception.InstanceEventTimeout:"},{"line_number":8255,"context_line":"            # We did not receive all expected events from Neutron, a warning"},{"line_number":8256,"context_line":"            # has already been logged by wait_for_instance_event, but we need"},{"line_number":8257,"context_line":"            # to decide if the issue is fatal."}],"source_content_type":"text/x-python","patch_set":22,"id":"66c278c6_4bdb38ef","line":8254,"in_reply_to":"3a5a2c44_aa10654c","updated":"2025-07-25 07:38:48.000000000","message":"I\u0027m not sure fully understand the question.\n\nThe exception is re-raised from virtapi here https://review.opendev.org/c/openstack/nova/+/949754/22/nova/compute/manager.py#600 afaik","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9a817fb6b5f1f12e5f1e77e4313b2f6c6d594488","unresolved":true,"context_lines":[{"line_number":8251,"context_line":"                        context, xml, instance,"},{"line_number":8252,"context_line":"                        pause\u003dpause, power_on\u003dpower_on,"},{"line_number":8253,"context_line":"                        post_xml_callback\u003dpost_xml_callback)"},{"line_number":8254,"context_line":"        except exception.InstanceEventTimeout:"},{"line_number":8255,"context_line":"            # We did not receive all expected events from Neutron, a warning"},{"line_number":8256,"context_line":"            # has already been logged by wait_for_instance_event, but we need"},{"line_number":8257,"context_line":"            # to decide if the issue is fatal."}],"source_content_type":"text/x-python","patch_set":22,"id":"9c7dc8c5_6ab87fa8","line":8254,"in_reply_to":"b8acbaa7_1841ca58","updated":"2025-07-25 15:01:03.000000000","message":"Okay yeah I was remembering this a little upside down. I was thinking we did the actual wait back in the compute manager and then unpausing instead of delegating the wait down to the driver like this. The `__exit__` from L8242 is what does the actual wait and what would raise the timeout if necessary.","commit_id":"07e88b014e366df4789a642084709c619e6e6f83"}]}
