)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3e07fcae1c17192b77ab53f700da344ad5450f59","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0c9c6f45_65ec5106","updated":"2026-02-05 16:09:29.000000000","message":"I tested this in devstack. Without this change the following creates 10 VMs hanging in BUILD\n```\nopenstack server create --image cirros-0.6.3-x86_64-disk --flavor c1 --nic net-id\u003dpublic --min 10 --max 10 vm \n```\nAfter this patch the 10 VM goes to ACTIVE as expected. So this patch resolve the short term issue.","commit_id":"31bec927d784064416c28c07546d8fbb28bb29e4"}],"nova/compute/manager.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"72e12c5c4d1e46d8f1fc1f48745f3c9603df33f7","unresolved":true,"context_lines":[{"line_number":2409,"context_line":"            # locked because we could wait in line to build this instance"},{"line_number":2410,"context_line":"            # for a while and we want to make sure that nothing else tries"},{"line_number":2411,"context_line":"            # to do anything with this instance while we wait."},{"line_number":2412,"context_line":"            with self._build_semaphore:"},{"line_number":2413,"context_line":"                try:"},{"line_number":2414,"context_line":"                    result \u003d self._do_build_and_run_instance(*args, **kwargs)"},{"line_number":2415,"context_line":"                except Exception:"}],"source_content_type":"text/x-python","patch_set":1,"id":"aaf2733c_bcb4c2ce","side":"PARENT","line":2412,"updated":"2026-02-05 00:26:22.000000000","message":"as in i think you can keep the rest fo the code as it was and just make this with with FairLockGuard(\"nova-\" + instance.uuid):\n\nbut i would have to check if that will return the same lock as \nlock \u003d lockutils.internal_lock(\"nova-\" + instance.uuid)\n\n---\nlater i guess not\n\n lockutils.internal_lock calls et on _semaphores\n\nhttps://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L175-L213\n\n\nthe FairlockGuard is usign \n\nhttps://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L130-L168\n\n\nsynchorized can use either but fair default to false\n\nhttps://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L464\n\n\nso we take the else barnch \nhttps://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L371-L388\n\nand end up iusing a internal_lock instead of internal_fair_lock\n\northerwise they woudl be the same.\n\nif you use lock directly \n\nhttps://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L318C5-L318C9\n\nit will use teh same internal_lock but its decorated with \n\n@contextlib.contextmanager \n\nso you could get rid of the mnanual lock.aquire and lock.release\n\nso \n\nwith self._build_semaphore: -\u003e with lockutils.lock(\"nova-\" + instance.uuid):","commit_id":"52a3674ca2deb98c4b636a243fd56a3ebc02b01a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"79b80b1a41a315803f43f71a5dbdd44d2a060031","unresolved":true,"context_lines":[{"line_number":2430,"context_line":"        # for a while and we want to make sure that nothing else tries"},{"line_number":2431,"context_line":"        # to do anything with this instance while we wait."},{"line_number":2432,"context_line":"        lock \u003d lockutils.internal_lock(\"nova-\" + instance.uuid)"},{"line_number":2433,"context_line":"        lock.acquire()"},{"line_number":2434,"context_line":""},{"line_number":2435,"context_line":"        def _locked_do_build_and_run_instance(*args, **kwargs):"},{"line_number":2436,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa895b76_40f05a54","line":2433,"updated":"2026-02-05 00:08:51.000000000","message":"i would need to think about this to be sure but i think you can just use the fairlockguard here","commit_id":"2796d43ac501433f6c0acca685f15642cddb5e46"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cdd550e1c005900d89a74bdf03cb5be0168121f6","unresolved":true,"context_lines":[{"line_number":2430,"context_line":"        # for a while and we want to make sure that nothing else tries"},{"line_number":2431,"context_line":"        # to do anything with this instance while we wait."},{"line_number":2432,"context_line":"        lock \u003d lockutils.internal_lock(\"nova-\" + instance.uuid)"},{"line_number":2433,"context_line":"        lock.acquire()"},{"line_number":2434,"context_line":""},{"line_number":2435,"context_line":"        def _locked_do_build_and_run_instance(*args, **kwargs):"},{"line_number":2436,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"d7a76696_58a36ee7","line":2433,"in_reply_to":"fa895b76_40f05a54","updated":"2026-02-05 13:00:51.000000000","message":"So the deal here is that the original code ensured that while the build_and_run_instance request is waiting on the semaphore no other lifecycle operation is executed on the same instance.uuid (like delete). We want to keep that in the new code.\n\nThe new code implements the concurrent build limit not by a semaphore but by the number of workers in the _build_executor. So the original lock behind         `@utils.synchronized(instance.uuid)` is no good as that code will only execute after the build_and_run_instance tasks is started running. As the wait due to the limit moved earlier we need to move the locking earlier as well, before the wait starts. This splits the lock across thread boundaries. The acquire() needs to happen before the task enters the Executor\u0027s queue. The release() needs to happen after the task finishes. As the RPC is not waiting for the task to finish we cannot just use context manager here. We need to release the lock within the task. One alternative to this split ugliness is to register a task finish callback on the future and let that release a lock. (I will do that as it is less complex).","commit_id":"2796d43ac501433f6c0acca685f15642cddb5e46"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e483bd03345fded623ccbac62c9d0d61ee5142ed","unresolved":true,"context_lines":[{"line_number":676,"context_line":"            self._build_semaphore \u003d threading.Semaphore("},{"line_number":677,"context_line":"                CONF.max_concurrent_builds)"},{"line_number":678,"context_line":"            self._build_executor \u003d utils.create_executor("},{"line_number":679,"context_line":"                CONF.max_concurrent_builds)"},{"line_number":680,"context_line":"        else:"},{"line_number":681,"context_line":"            self._build_semaphore \u003d compute_utils.UnlimitedSemaphore()"},{"line_number":682,"context_line":"            # setting CONF.max_concurrent_builds to 0 (unlimited)"}],"source_content_type":"text/x-python","patch_set":3,"id":"c2233df4_e3daee32","line":679,"updated":"2026-02-05 16:26:40.000000000","message":"* We need a refactor to get properly named executors.\n* We need a way to selectively configure that an executor should warn if full. For generic executors like the default one that make sense. For the this one it is less so as it created with a small size intentionally to queue up build requests.","commit_id":"31bec927d784064416c28c07546d8fbb28bb29e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e483bd03345fded623ccbac62c9d0d61ee5142ed","unresolved":true,"context_lines":[{"line_number":682,"context_line":"            # setting CONF.max_concurrent_builds to 0 (unlimited)"},{"line_number":683,"context_line":"            # is deprecated but still supported, so we need to use a sane"},{"line_number":684,"context_line":"            # default values for each threading mode"},{"line_number":685,"context_line":"            LOG.warning(\"Nova compute deprecated the support of unlimited \""},{"line_number":686,"context_line":"                        \"parallel builds so \""},{"line_number":687,"context_line":"                        \"[DEFAULT]max_concurrent_builds configured \""},{"line_number":688,"context_line":"                        \"with value 0 is deprecated and will not be supported \""}],"source_content_type":"text/x-python","patch_set":3,"id":"7e293d99_d70e7445","line":685,"updated":"2026-02-05 16:26:40.000000000","message":"We need to do the deprecation in the config definition as well and add a release notes about it.","commit_id":"31bec927d784064416c28c07546d8fbb28bb29e4"}]}
