)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"043f9f185596c3a081c7ed6086c02c19aa506b7e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"804a82b5_c18ba8c0","updated":"2026-09-28 10:10:31.000000000","message":"recheck","commit_id":"1fba451f5b47041692bfc429704bf5c21561df16"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"70ca02783660ac892d1677002893ef4d66a9e97d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"9036c2f3_5c8fdc4a","updated":"2026-11-10 00:26:18.000000000","message":"1 nit for comment which you can fix if respin or we can update it later.","commit_id":"c596327ec8ed8abaa15249d311cffb25e1c0a528"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"59980e251a3e807326a9282647dc1f03b46bf1f3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":14,"id":"19b03205_95c82cee","updated":"2026-11-09 17:28:28.000000000","message":"Thanks Kamil, lgtm","commit_id":"c596327ec8ed8abaa15249d311cffb25e1c0a528"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"26a69b2c519ee7c4b52b77d8c61573b500bb50de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"10432d9e_869a788d","updated":"2026-11-10 08:37:54.000000000","message":"Thank you for review!","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d247292b2f19f5c0c03c7e7d11dd8bdc435dd557","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"ee42cf9f_3966254d","updated":"2026-11-10 12:23:27.000000000","message":"t","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"06c03cba03641429d262baca185aae4d479ceae2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"bc9a4787_9e316c38","updated":"2026-11-13 00:58:21.000000000","message":"I am good to use default executor in event handlers but question on the implementation.","commit_id":"4900799b16f1d37af9cf8f552265e47ce11f67b0"}],"nova/thread_pool_factory.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"06c03cba03641429d262baca185aae4d479ceae2","unresolved":true,"context_lines":[{"line_number":433,"context_line":"    \"\"\""},{"line_number":434,"context_line":"    return spawn_on(ExecutorType.DEFAULT, func, *args, **kwargs)"},{"line_number":435,"context_line":""},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"class _SharedPoolExecutor(futures.Executor):"},{"line_number":438,"context_line":"    \"\"\"Executor that runs the submitted work on another executor."},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"    Base of the delaying executors below, so they add submit_after() to an"},{"line_number":441,"context_line":"    existing pool instead of creating workers of their own."},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"    shutdown() leaves the wrapped executor alone, we did not"},{"line_number":444,"context_line":"    create it and it may be shared with other callers."},{"line_number":445,"context_line":"    \"\"\""},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def __init__(self, executor: Executor):"}],"source_content_type":"text/x-python","patch_set":17,"id":"fe06d994_a8d95a03","line":444,"range":{"start_line":436,"start_character":0,"end_line":444,"end_character":54},"updated":"2026-11-13 00:58:21.000000000","message":"This seems like a workaround in nova. From a futurist DelayingExecutor perspective, it sometimes shuts down the executor, and sometimes not.  I think we should be able to handle it in futurist.\n\nI expected futurist\u0027s DelayingExecutor to know when it owns the executor and when it doesn\u0027t, so it can act accordingly on shutdown. I was thinking for futurist to take the \u0027executor\u0027 as an argument so that futurist knows whether it owns the executors (it came from the multiple inheritance and no \u0027executor\u0027 is passed in init) or does not own them (if \u0027executor\u0027 is passed in init), and in the former case, it can shut down the scheduler as well as the executor (which is the current impl) and in the latter case, it should only shut down the scheduler. That way, it could be generic in the future if other projects have the same use cases.\n\nAs we want to use the futurist impl, let\u0027s also add this case (passing executor) generically in futurist only.","commit_id":"4900799b16f1d37af9cf8f552265e47ce11f67b0"}],"nova/utils.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"eab48c9246ed20afb684f36d2c9225a988717c26","unresolved":true,"context_lines":[{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class DelayingExecutor("},{"line_number":1443,"context_line":"    futurist.DelayedExecutorMixin,"},{"line_number":1444,"context_line":"    futurist.ThreadPoolExecutor,"},{"line_number":1445,"context_line":"):"},{"line_number":1446,"context_line":"    \"\"\"Thread-pool executor that supports per-task delayed submission."},{"line_number":1447,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"8857ff8e_c2492ec8","line":1444,"updated":"2026-07-31 08:40:55.000000000","message":"I think we should use a GreenThreadPoolExecutor in an eventlet environment insted of a native ThreadPool","commit_id":"f5a8a007ade701365659696b499f415bad9c0607"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"238fe67b0d124803cbdc5d831938183c566a37aa","unresolved":false,"context_lines":[{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"class DelayingExecutor("},{"line_number":1443,"context_line":"    futurist.DelayedExecutorMixin,"},{"line_number":1444,"context_line":"    futurist.ThreadPoolExecutor,"},{"line_number":1445,"context_line":"):"},{"line_number":1446,"context_line":"    \"\"\"Thread-pool executor that supports per-task delayed submission."},{"line_number":1447,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"d756cee9_c73b5613","line":1444,"in_reply_to":"8857ff8e_c2492ec8","updated":"2026-08-06 09:22:26.000000000","message":"NA","commit_id":"f5a8a007ade701365659696b499f415bad9c0607"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"f5c98f9418892c64876cbdae19d1cd9aaa08a18d","unresolved":false,"context_lines":[{"line_number":1469,"context_line":"    \"\"\""},{"line_number":1470,"context_line":""},{"line_number":1471,"context_line":"DelayingExecutor: ty.TypeAlias \u003d _GreenDelayingExecutor | _ThreadDelayingExecutor"},{"line_number":1472,"context_line":""},{"line_number":1473,"context_line":""},{"line_number":1474,"context_line":"def create_delaying_executor(max_workers: int, **kwargs) -\u003e DelayingExecutor:"},{"line_number":1475,"context_line":"    \"\"\"Create a delaying executor for the current concurrency mode."}],"source_content_type":"text/x-python","patch_set":4,"id":"1936f6a1_3924d97c","line":1472,"updated":"2026-08-04 11:22:29.000000000","message":"pep8: E501 line too long (81 \u003e 79 characters)","commit_id":"8bec3296a46c687496fb6bbd46053b6a44bf17bb"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"17a079fd34396d9f479c6b0eb6564b3265bec32d","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":13,"id":"f16297d9_16cedafc","line":1272,"range":{"start_line":1220,"start_character":0,"end_line":1272,"end_character":0},"updated":"2026-11-06 20:11:07.000000000","message":"during refactoring, we moved all the executors and related code to thread_pool_factory, i prefer to move these new eecutors also there so that we can maintain them in central place?","commit_id":"d4c70d6de6e02cd71bc6c5f936c6631a71991413"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"59980e251a3e807326a9282647dc1f03b46bf1f3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"531b9957_2cf0cfd6","line":1272,"range":{"start_line":1220,"start_character":0,"end_line":1272,"end_character":0},"in_reply_to":"f16297d9_16cedafc","updated":"2026-11-09 17:28:28.000000000","message":"Done","commit_id":"d4c70d6de6e02cd71bc6c5f936c6631a71991413"}],"nova/virt/libvirt/host.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"c9c911158150c8aa7d799e16a1db1c730e7bb1ac","unresolved":false,"context_lines":[{"line_number":524,"context_line":"            event.transition \u003d\u003d virtevent.EVENT_LIFECYCLE_STOPPED):"},{"line_number":525,"context_line":"            # Delay STOPPED event, as they may be followed by a STARTED"},{"line_number":526,"context_line":"            # event in case the instance is rebooting"},{"line_number":527,"context_line":"            future \u003d self._delayed_executor.submit_after("},{"line_number":528,"context_line":"                15, self._event_emit, event)"},{"line_number":529,"context_line":"            self._events_delayed[event.uuid] \u003d future"},{"line_number":530,"context_line":"            # add callback to cleanup self._events_delayed dict after"}],"source_content_type":"text/x-python","patch_set":2,"id":"4205c22a_2abc5f49","line":527,"updated":"2026-07-16 16:13:13.000000000","message":"pep8: error: Item \"None\" of \"Any | None\" has no attribute \"submit_after\"  [union-attr]","commit_id":"2ded7c35a2f99e40d4b9233ca253016d50d50114"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"eab48c9246ed20afb684f36d2c9225a988717c26","unresolved":true,"context_lines":[{"line_number":543,"context_line":"        \"\"\""},{"line_number":544,"context_line":"        self._delayed_executor \u003d ("},{"line_number":545,"context_line":"            utils.StaticallyDelayingCancellableTaskExecutorWrapper("},{"line_number":546,"context_line":"                delay\u003d15, executor\u003dutils._get_default_executor()))"},{"line_number":547,"context_line":"        self._event_handler.start()"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":3,"id":"a2087373_06b57a86","side":"PARENT","line":546,"updated":"2026-07-31 08:40:55.000000000","message":"This combines a GreenThreadPool or a native ThreadPool with the delaying mechanism based on what concurrency mode we are running in.\nBut the new code uses utils.DelayingExecutor that hardcodes the native ThreadPool. So I\u0027m not sure this change will work well in an eventlet environment.","commit_id":"1c85163992293df8ed041e7d986f68a7f95fdc21"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"65673a4ed9a988e3adc0c8c24abd3b5ae47b5a49","unresolved":false,"context_lines":[{"line_number":543,"context_line":"        \"\"\""},{"line_number":544,"context_line":"        self._delayed_executor \u003d ("},{"line_number":545,"context_line":"            utils.StaticallyDelayingCancellableTaskExecutorWrapper("},{"line_number":546,"context_line":"                delay\u003d15, executor\u003dutils._get_default_executor()))"},{"line_number":547,"context_line":"        self._event_handler.start()"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":3,"id":"f2f1ae7a_7780b1c3","side":"PARENT","line":546,"in_reply_to":"a2087373_06b57a86","updated":"2026-08-14 10:33:38.000000000","message":"Done","commit_id":"1c85163992293df8ed041e7d986f68a7f95fdc21"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"238fe67b0d124803cbdc5d831938183c566a37aa","unresolved":true,"context_lines":[{"line_number":544,"context_line":"    def _init_events(self):"},{"line_number":545,"context_line":"        \"\"\"Initializes the libvirt events subsystem."},{"line_number":546,"context_line":"        \"\"\""},{"line_number":547,"context_line":"        self._delayed_executor \u003d utils.create_delaying_executor(max_workers\u003d1)"},{"line_number":548,"context_line":"        self._event_handler.start()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":4,"id":"b5ac76c3_126dfd0a","line":547,"updated":"2026-08-06 09:22:26.000000000","message":"this is now functionally different from the baseline. In the baseline we wrapped the default_executor to get the delay functionality. As far as I see this creates a separate executor and not re-using the default one.","commit_id":"8bec3296a46c687496fb6bbd46053b6a44bf17bb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"b62a1799e12aefbd5ae0258783bda11f798513d6","unresolved":true,"context_lines":[{"line_number":544,"context_line":"    def _init_events(self):"},{"line_number":545,"context_line":"        \"\"\"Initializes the libvirt events subsystem."},{"line_number":546,"context_line":"        \"\"\""},{"line_number":547,"context_line":"        self._delayed_executor \u003d utils.create_delaying_executor(max_workers\u003d1)"},{"line_number":548,"context_line":"        self._event_handler.start()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":4,"id":"f2e47414_276199e2","line":547,"in_reply_to":"b5ac76c3_126dfd0a","updated":"2026-08-12 13:16:04.000000000","message":"also the max_worker\u003d1 will give us a pretty different behavior of event handling on a compute with multiple VMs.","commit_id":"8bec3296a46c687496fb6bbd46053b6a44bf17bb"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"c7da5a63376f86068b9d450cd16a456d278797f1","unresolved":true,"context_lines":[{"line_number":544,"context_line":"    def _init_events(self):"},{"line_number":545,"context_line":"        \"\"\"Initializes the libvirt events subsystem."},{"line_number":546,"context_line":"        \"\"\""},{"line_number":547,"context_line":"        self._delayed_executor \u003d utils.create_delaying_executor(max_workers\u003d1)"},{"line_number":548,"context_line":"        self._event_handler.start()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":4,"id":"051c3837_ccb3e282","line":547,"in_reply_to":"f2e47414_276199e2","updated":"2026-11-12 10:36:44.000000000","message":"Both fixed in PS16. _init_events() wraps the default executor now, and\nthere is no max_workers at all - create_delaying_executor() takes an\nexecutor rather than a pool size.","commit_id":"8bec3296a46c687496fb6bbd46053b6a44bf17bb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"93d2ed38ca1f9cc30753bf62d65b1655e7fcd155","unresolved":true,"context_lines":[{"line_number":544,"context_line":"    def _init_events(self):"},{"line_number":545,"context_line":"        \"\"\"Initializes the libvirt events subsystem."},{"line_number":546,"context_line":"        \"\"\""},{"line_number":547,"context_line":"        self._delayed_executor \u003d utils._get_default_executor()"},{"line_number":548,"context_line":"        self._event_handler.start()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":6,"id":"85d63a13_f0c8a658","line":547,"updated":"2026-08-17 14:23:23.000000000","message":"Ok so we moved the wrapping to utils.py . This slightly changes the logic. Now every user of the default_executor can use submit_after(). The big difference is that in the new wrapper the delay is not static for every submit() call but dynamic an only applied to submit_after() calls. The submit calls are unaffected. So even if we expose the wrapped executor to all users of the default_executor they can still use it as normal without delay.\n\nHowever there is a downside of this move. The wrapper has an overhead, an extra scheduler thread running. so those processes that never use a default_executor with submit_after get the extra thread overhead unnecessarily.\n\nI would be happier if we only do the wrapping for the event handler usage of the executor where we know that the overhead is warranted as we need the submit_after capability.","commit_id":"698f541fca6fdc13f4d1429a0bff1046b18d4bc9"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"c7da5a63376f86068b9d450cd16a456d278797f1","unresolved":true,"context_lines":[{"line_number":544,"context_line":"    def _init_events(self):"},{"line_number":545,"context_line":"        \"\"\"Initializes the libvirt events subsystem."},{"line_number":546,"context_line":"        \"\"\""},{"line_number":547,"context_line":"        self._delayed_executor \u003d utils._get_default_executor()"},{"line_number":548,"context_line":"        self._event_handler.start()"},{"line_number":549,"context_line":""},{"line_number":550,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":6,"id":"b8dd00b3_b486c12c","line":547,"in_reply_to":"85d63a13_f0c8a658","updated":"2026-11-12 10:36:44.000000000","message":"Done in PS16. The wrapping is in Host._init_events(), not in the factory.\ncreate_delaying_executor() has exactly one caller in nova, so no other\nprocess gets the scheduler thread.","commit_id":"698f541fca6fdc13f4d1429a0bff1046b18d4bc9"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"17a079fd34396d9f479c6b0eb6564b3265bec32d","unresolved":true,"context_lines":[{"line_number":708,"context_line":"            future.cancel()"},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"        if self._delayed_executor:"},{"line_number":711,"context_line":"            self._delayed_executor.shutdown(wait\u003dTrue)"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    def _version_check(self, lv_ver\u003dNone, hv_ver\u003dNone, hv_type\u003dNone,"},{"line_number":714,"context_line":"                       op\u003doperator.lt):"}],"source_content_type":"text/x-python","patch_set":13,"id":"23272254_c98fa088","line":711,"range":{"start_line":711,"start_character":12,"end_line":711,"end_character":54},"updated":"2026-11-06 20:11:07.000000000","message":"I think we should call this with cancel_futures\u003dTrue so that we can cancel the events not submitted to the executor yet","commit_id":"d4c70d6de6e02cd71bc6c5f936c6631a71991413"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"59980e251a3e807326a9282647dc1f03b46bf1f3","unresolved":false,"context_lines":[{"line_number":708,"context_line":"            future.cancel()"},{"line_number":709,"context_line":""},{"line_number":710,"context_line":"        if self._delayed_executor:"},{"line_number":711,"context_line":"            self._delayed_executor.shutdown(wait\u003dTrue)"},{"line_number":712,"context_line":""},{"line_number":713,"context_line":"    def _version_check(self, lv_ver\u003dNone, hv_ver\u003dNone, hv_type\u003dNone,"},{"line_number":714,"context_line":"                       op\u003doperator.lt):"}],"source_content_type":"text/x-python","patch_set":13,"id":"678bff5a_483ab440","line":711,"range":{"start_line":711,"start_character":12,"end_line":711,"end_character":54},"in_reply_to":"23272254_c98fa088","updated":"2026-11-09 17:28:28.000000000","message":"Done","commit_id":"d4c70d6de6e02cd71bc6c5f936c6631a71991413"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"59980e251a3e807326a9282647dc1f03b46bf1f3","unresolved":true,"context_lines":[{"line_number":560,"context_line":"        # executor runs an extra scheduler thread to support submit_after(), so"},{"line_number":561,"context_line":"        # we only pay that overhead where the delay capability is actually"},{"line_number":562,"context_line":"        # needed."},{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"}],"source_content_type":"text/x-python","patch_set":14,"id":"8a1a8503_15f80667","line":564,"range":{"start_line":563,"start_character":8,"end_line":564,"end_character":52},"updated":"2026-11-09 17:28:28.000000000","message":"maybe at some point we might need separate configurable size for delay executor? but for now this lgtm.","commit_id":"c596327ec8ed8abaa15249d311cffb25e1c0a528"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"70ca02783660ac892d1677002893ef4d66a9e97d","unresolved":true,"context_lines":[{"line_number":697,"context_line":"        # as the _conn_event_thread loop to have a fully graceful and clean"},{"line_number":698,"context_line":"        # shutdown"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        # If domain STOPPED events are delayed then the executor shutdown can"},{"line_number":701,"context_line":"        # take up to 15 seconds. Also as nova-compute is shutting down not"},{"line_number":702,"context_line":"        # having a power off synced to the DB does not matter much as during"},{"line_number":703,"context_line":"        # the next nova-compute startup the power states are synced anyhow. So"},{"line_number":704,"context_line":"        # lets cancel all the outstanding delayed events instead of waiting a"}],"source_content_type":"text/x-python","patch_set":14,"id":"4aefeeae_7b99face","line":701,"range":{"start_line":700,"start_character":0,"end_line":701,"end_character":32},"updated":"2026-11-10 00:26:18.000000000","message":"While reviewing another change that stops the event handler, I realized all these events are disposed during cleanup_host. manager\u0027s cleanup_host() NONE-ify its callback listener[1], and libvirt drivers will just dispose the events in that case[2].  \n\nSo cancel_futures\u003dTrue will speed up the shutdown here by cancelling the events instead of waiting for 15 sec on their turn and the driver just disposing the events.\n\nWith that, i think we can update this comment. No change in code needed because cancelling events which are not yet executed is more fater then waiting for them to be disposed by driver when it does not find any callback on manager.\n\n[1] https://github.com/openstack/nova/blob/7f4ec7eac9af413ac847a4c04a19188a91e991ad/nova/compute/manager.py#L1766\n\n[2] https://github.com/openstack/nova/blob/7f4ec7eac9af413ac847a4c04a19188a91e991ad/nova/virt/driver.py#L1897","commit_id":"c596327ec8ed8abaa15249d311cffb25e1c0a528"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"26a69b2c519ee7c4b52b77d8c61573b500bb50de","unresolved":false,"context_lines":[{"line_number":697,"context_line":"        # as the _conn_event_thread loop to have a fully graceful and clean"},{"line_number":698,"context_line":"        # shutdown"},{"line_number":699,"context_line":""},{"line_number":700,"context_line":"        # If domain STOPPED events are delayed then the executor shutdown can"},{"line_number":701,"context_line":"        # take up to 15 seconds. Also as nova-compute is shutting down not"},{"line_number":702,"context_line":"        # having a power off synced to the DB does not matter much as during"},{"line_number":703,"context_line":"        # the next nova-compute startup the power states are synced anyhow. So"},{"line_number":704,"context_line":"        # lets cancel all the outstanding delayed events instead of waiting a"}],"source_content_type":"text/x-python","patch_set":14,"id":"35a4fab6_ff72e42d","line":701,"range":{"start_line":700,"start_character":0,"end_line":701,"end_character":32},"in_reply_to":"4aefeeae_7b99face","updated":"2026-11-10 08:37:54.000000000","message":"Done","commit_id":"c596327ec8ed8abaa15249d311cffb25e1c0a528"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d247292b2f19f5c0c03c7e7d11dd8bdc435dd557","unresolved":true,"context_lines":[{"line_number":206,"context_line":"        # events pending"},{"line_number":207,"context_line":"        try:"},{"line_number":208,"context_line":"            _c \u003d self._event_notify_recv.read(1)"},{"line_number":209,"context_line":"            if not _c:"},{"line_number":210,"context_line":"                raise RuntimeError("},{"line_number":211,"context_line":"                    \"Failed to read event notification from pipe\")"},{"line_number":212,"context_line":"        except ValueError:"}],"source_content_type":"text/x-python","patch_set":15,"id":"53350e64_e96d75a3","line":209,"updated":"2026-11-10 12:23:27.000000000","message":"what is the reason changing this?\n\nI would leave it alone if possible here in this patch. In a followup I\u0027m fine to even drop this assert from the code. It has not much purpose in my eyes but I haven\u0027t tried removing it.","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"c7da5a63376f86068b9d450cd16a456d278797f1","unresolved":true,"context_lines":[{"line_number":206,"context_line":"        # events pending"},{"line_number":207,"context_line":"        try:"},{"line_number":208,"context_line":"            _c \u003d self._event_notify_recv.read(1)"},{"line_number":209,"context_line":"            if not _c:"},{"line_number":210,"context_line":"                raise RuntimeError("},{"line_number":211,"context_line":"                    \"Failed to read event notification from pipe\")"},{"line_number":212,"context_line":"        except ValueError:"}],"source_content_type":"text/x-python","patch_set":15,"id":"6ffbcdd9_90ecdccd","line":209,"in_reply_to":"53350e64_e96d75a3","updated":"2026-11-12 10:36:44.000000000","message":"No good reason, it crept in. Reverted in PS16, the line is identical to\nmaster again. Agreed it is better as its own follow-up.","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d247292b2f19f5c0c03c7e7d11dd8bdc435dd557","unresolved":true,"context_lines":[{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":15,"id":"e6035666_c563e8a0","line":566,"updated":"2026-11-10 12:23:27.000000000","message":"This has the downside that now we are adding more running threads to a busy compute service. Both the default_executor and the delayed_executor can have max_workers number of threads running independently.\n\nThe baseline code reused the default executor and just wrapped it to add the delaying functionality to it here. That means sharing a single set of max_workers for both usage. That is a lot leaner. \n\nCan we have that logic now with the futurist impl?","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"06c03cba03641429d262baca185aae4d479ceae2","unresolved":true,"context_lines":[{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":15,"id":"e1fae473_34254b16","line":566,"in_reply_to":"03aecacf_9c42fae0","updated":"2026-11-13 00:58:21.000000000","message":"\u003e the actual task to execute is short afaik\n\n\u003e Even if the current impl causes some other tasks to wait I would first consider adding workers to the default pool before I suggest to split out a pool.\n\nGiven event tasks are fast, increasing the default executor\u0027s worker count if we see slowness is a good point. I think I am convinced to use the default executor here, and if needed, we can increase the default executor\u0027s workers, which is nothing different from allocating separate workers to event handlers at the start itself.","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"633384c5ca977ee65dc94fa2840d4c76a6e834b5","unresolved":true,"context_lines":[{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":15,"id":"ceab3167_3c55fec1","line":566,"in_reply_to":"33e04414_b0a48f50","updated":"2026-11-10 19:35:06.000000000","message":"I am thinking that using the default executor can be unnecessary here and sometimes overwhelming for the default executor. With the futurist impl, it allows having more than one delayed task in executors (as soon as the delay time is over). I mean tasks are submitted to executors in parallel, and it can consume many threads of the default executors.\n\nGiven that this delayed executor is used only for the server STOPPED events, I feel that having separate executors, but with minimal (1 or 2) workers, is good enough here.\n\n[1] https://github.com/openstack/futurist/blob/5ffbc5bb1d7046545d47194456ed1aec06c4ede9/futurist/_futures.py#L990-L993","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":11082,"name":"Kamil Sambor","email":"ksambor@redhat.com","username":"ksambor"},"change_message_id":"c7da5a63376f86068b9d450cd16a456d278797f1","unresolved":true,"context_lines":[{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":15,"id":"03aecacf_9c42fae0","line":566,"in_reply_to":"902c37a5_eb2d8256","updated":"2026-11-12 10:36:44.000000000","message":"Done in PS16 as a 1:1 replacement. _SharedPoolExecutor is a thin\nconcurrent.futures.Executor whose submit() delegates to the executor passed\nin; the futurist mixin composes on top of that instead of on a\n(Green)ThreadPoolExecutor. So delayed work runs on the default pool\u0027s\nworkers and the only new thread is the mixin\u0027s scheduler, created once in\n_init_events().","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fea3bc257483096192a57c69908e224d9080b1af","unresolved":true,"context_lines":[{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":15,"id":"902c37a5_eb2d8256","line":566,"in_reply_to":"ceab3167_3c55fec1","updated":"2026-11-11 12:47:08.000000000","message":"two things:\n1. delayed tasks are not consuming worker processes. They are sent to the executor after their delay finished\n2. the actual task to execute is short afaik\n\nHaving a separate executor would mean more overall memory load as even an idle worker is consuming memory. I still on the side to use the default executor for this. We do that in Hibiscus and so far we haven\u0027t see any downside of this. So I would not add more potential worker threads into compute. Even if the current impl causes some other tasks to wait I would first consider adding workers to the default pool before I suggest to split out a pool. A single pool give us more possibility to reuse workers for different purposes.\n\nbottom line: I still suggest to do a 1:1 replacement of logic. I.e. wrap the default executor to reuse the workers there. And warp it only for the compute service / libvirt driver to pay the cost of the scheduler thread only when we know that delayed tasks are used.","commit_id":"680692155eed22b071591c557c8a294ce56bc766"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"f4a7c1bd70605b50fe8aa04ff7d82844b699448e","unresolved":true,"context_lines":[{"line_number":563,"context_line":"        max_workers \u003d thread_pool_factory.ExecutorsPoolSize.get("},{"line_number":564,"context_line":"            thread_pool_factory.ExecutorType.DEFAULT)"},{"line_number":565,"context_line":"        self._delayed_executor \u003d thread_pool_factory.create_delaying_executor("},{"line_number":566,"context_line":"            max_workers)"},{"line_number":567,"context_line":"        self._event_handler.start()"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":"        # This thread is just for async connection closed event handling."}],"source_content_type":"text/x-python","patch_set":15,"id":"33e04414_b0a48f50","line":566,"in_reply_to":"e6035666_c563e8a0","updated":"2026-11-10 17:27:16.000000000","message":"ah right, got it now. It doubles the number of threads. Good catch. The best possible solution until we change the futurist impl can be to have 2 max_workers? delayed_executor is only used for the EVENT_LIFECYCLE_STOPPED event, which might be ok to wait on in executors?\n\n\u003e Can we have that logic now with the futurist impl?\n\nYou mean the futurist impl should take the executor as an argument and use that instead of creating a new one?","commit_id":"680692155eed22b071591c557c8a294ce56bc766"}]}
