)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"82f5ac312c0458cf27ec5d948719fbd64bbc39f0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"df623eb0_d482ea40","updated":"2026-09-23 19:09:16.000000000","message":"Some open questions on the bug report before we proceed with this fix\n\nhttps://bugs.launchpad.net/glance-store/+bug/2163165/comments/2","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"aa8c102a33eaac69a187e229ab406101c7ea3276","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"465e8ba0_1d73fc52","updated":"2026-10-13 08:41:13.000000000","message":"We are on it to test this issue again with the more granular lock, but we have some test env issues downstream.","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"33b40db1c79381ac078ea81895ff3d9abeb37858","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"3d854174_21f4ec34","in_reply_to":"df623eb0_d482ea40","updated":"2026-09-24 17:10:02.000000000","message":"thanks I will make it clearer to have all information in the patch and the bug report","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"}],"glance_store/_drivers/cinder/store.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"f0484b179a5fb75ec6745db75da19ff135e04b33","unresolved":true,"context_lines":[{"line_number":935,"context_line":"            root_helper, my_ip, use_multipath, enforce_multipath, host\u003dhost)"},{"line_number":936,"context_line":""},{"line_number":937,"context_line":"        @utils.synchronized(volume_id, external\u003dTrue)"},{"line_number":938,"context_line":"        def _attach_volume():"},{"line_number":939,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":940,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":941,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"aff89945_3dcad1e4","line":938,"updated":"2026-08-27 17:37:47.000000000","message":"This method is large enough that it should be moved into a regular method in the class rather than it remaining inside of _open_cinder_volume().","commit_id":"d516ef9672d9a437eb740a2f550e02d69a6d9b96"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"5ab217e308522b7691a5709171e5b5ec252594c6","unresolved":false,"context_lines":[{"line_number":935,"context_line":"            root_helper, my_ip, use_multipath, enforce_multipath, host\u003dhost)"},{"line_number":936,"context_line":""},{"line_number":937,"context_line":"        @utils.synchronized(volume_id, external\u003dTrue)"},{"line_number":938,"context_line":"        def _attach_volume():"},{"line_number":939,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":940,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":941,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"accf7fab_4d2e6e0d","line":938,"in_reply_to":"aff89945_3dcad1e4","updated":"2026-08-28 10:45:32.000000000","message":"good idea, I moved it to thin _attach_volume and to keep the synchronized decorator added the _attach_volume_with_lock, the same pattern as _disconnect_and_detach -\u003e _disconnect_and_detach_with_lock","commit_id":"d516ef9672d9a437eb740a2f550e02d69a6d9b96"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"f0484b179a5fb75ec6745db75da19ff135e04b33","unresolved":true,"context_lines":[{"line_number":943,"context_line":""},{"line_number":944,"context_line":"            vol \u003d self.volume_api.get(client, volume_id)"},{"line_number":945,"context_line":"            att_id \u003d attachment[\u0027id\u0027]"},{"line_number":946,"context_line":"            c \u003d None"},{"line_number":947,"context_line":"            dev \u003d None"},{"line_number":948,"context_line":"            try:"},{"line_number":949,"context_line":"                attachment \u003d self.volume_api.attachment_update("}],"source_content_type":"text/x-python","patch_set":2,"id":"8e9c3f6b_be06b080","line":946,"updated":"2026-08-27 17:37:47.000000000","message":"Keeping the name \"conn\" as it was before instead of \"c\" would be better for readability.","commit_id":"d516ef9672d9a437eb740a2f550e02d69a6d9b96"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"5ab217e308522b7691a5709171e5b5ec252594c6","unresolved":false,"context_lines":[{"line_number":943,"context_line":""},{"line_number":944,"context_line":"            vol \u003d self.volume_api.get(client, volume_id)"},{"line_number":945,"context_line":"            att_id \u003d attachment[\u0027id\u0027]"},{"line_number":946,"context_line":"            c \u003d None"},{"line_number":947,"context_line":"            dev \u003d None"},{"line_number":948,"context_line":"            try:"},{"line_number":949,"context_line":"                attachment \u003d self.volume_api.attachment_update("}],"source_content_type":"text/x-python","patch_set":2,"id":"6e745f69_21e95bcf","line":946,"in_reply_to":"8e9c3f6b_be06b080","updated":"2026-08-28 10:45:32.000000000","message":"changed to conn to avoid names like c, thanks","commit_id":"d516ef9672d9a437eb740a2f550e02d69a6d9b96"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"82f5ac312c0458cf27ec5d948719fbd64bbc39f0","unresolved":true,"context_lines":[{"line_number":924,"context_line":"            root_helper \u003d self.get_root_helper()"},{"line_number":925,"context_line":"            use_multipath \u003d self.store_conf.cinder_use_multipath"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":928,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":929,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"},{"line_number":930,"context_line":"                      {\u0027attachment_id\u0027: attachment[\u0027id\u0027]})"},{"line_number":931,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"b270c8aa_9d845c84","line":928,"range":{"start_line":927,"start_character":0,"end_line":928,"end_character":52},"updated":"2026-09-23 19:09:16.000000000","message":"Only attachment_create can influence the decision of attachment counting during the detach operation so putting the whole method inside the lock doesn\u0027t seem good for performance and maybe only locking this call can make things work.","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"3b6e9a4f48276bfe8565149770c54644f1d5660a","unresolved":true,"context_lines":[{"line_number":924,"context_line":"            root_helper \u003d self.get_root_helper()"},{"line_number":925,"context_line":"            use_multipath \u003d self.store_conf.cinder_use_multipath"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":928,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":929,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"},{"line_number":930,"context_line":"                      {\u0027attachment_id\u0027: attachment[\u0027id\u0027]})"},{"line_number":931,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9c34a398_313838ad","line":928,"range":{"start_line":927,"start_character":0,"end_line":928,"end_character":52},"in_reply_to":"309b0cec_146474b7","updated":"2026-10-16 15:07:25.000000000","message":"Hi, We had the machine time in the lab for this finally, and with the lock around only the attachment_create we failed the same way, so the localized lock is not enough to cover the race, see our logs: https://paste.opendev.org/show/bZroWCss1tKkg8ZBPIgj/\n\nReally thanks for the comment it is really good to check in detail what happens.","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"5d29d7286418afc8b5b65346176f8e46bf777305","unresolved":true,"context_lines":[{"line_number":924,"context_line":"            root_helper \u003d self.get_root_helper()"},{"line_number":925,"context_line":"            use_multipath \u003d self.store_conf.cinder_use_multipath"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":928,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":929,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"},{"line_number":930,"context_line":"                      {\u0027attachment_id\u0027: attachment[\u0027id\u0027]})"},{"line_number":931,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5d1b026e_17958d78","line":928,"range":{"start_line":927,"start_character":0,"end_line":928,"end_character":52},"in_reply_to":"49641c89_244368af","updated":"2026-09-28 10:16:28.000000000","message":"Based on the bug report, the issue reported is due to the counting mechanism that could race with the attachment create call\n\nBased on the following series of event described, it should be resolved with a lock around the attachment create call\n\n2. Request A finishes reading, enters _disconnect_and_detach_with_lock,\n   acquires the file lock on volume_id.\n3. Inside the lock, it queries volume.attachments, sees only 1 (its own),\n   decides should_disconnect \u003d True.\n4. Meanwhile, Request B (unlocked) has progressed through connect_volume —\n   os-brick reuses the same device path for the multiattach volume.\n   \n   \nIf we\u0027ve a lock on attachment create then the lock will keep waiting at step 3 and will never reach step 4 until the volume is completely detached and disconnected from the glance host and then will proceed to create an attachment which should not fail at the chown stage (since a fresh mapping and connect steps would be executed)\n\nOtherwise if the attachment_create happens before the lock is acquired by disconnect_and_detach then in the attachment counting we will have 2 attachments hence the unmapping won\u0027t happen\n\nIf feasible, can you try executing the workflow with only a lock around attachment_create call?","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"99ad495f9703f469c398bc368183dfa79bec8730","unresolved":true,"context_lines":[{"line_number":924,"context_line":"            root_helper \u003d self.get_root_helper()"},{"line_number":925,"context_line":"            use_multipath \u003d self.store_conf.cinder_use_multipath"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":928,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":929,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"},{"line_number":930,"context_line":"                      {\u0027attachment_id\u0027: attachment[\u0027id\u0027]})"},{"line_number":931,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"309b0cec_146474b7","line":928,"range":{"start_line":927,"start_character":0,"end_line":928,"end_character":52},"in_reply_to":"5d1b026e_17958d78","updated":"2026-09-28 16:45:29.000000000","message":"Sure, I check it and try to fetch an env in the lab to test it","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"c60454e5b9a7e52901909b2b761b79fa65ad7e95","unresolved":true,"context_lines":[{"line_number":924,"context_line":"            root_helper \u003d self.get_root_helper()"},{"line_number":925,"context_line":"            use_multipath \u003d self.store_conf.cinder_use_multipath"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":928,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":929,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"},{"line_number":930,"context_line":"                      {\u0027attachment_id\u0027: attachment[\u0027id\u0027]})"},{"line_number":931,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"49641c89_244368af","line":928,"range":{"start_line":927,"start_character":0,"end_line":928,"end_character":52},"in_reply_to":"9f2463df_28c28318","updated":"2026-09-25 15:39:19.000000000","message":"I checked it and as I commented in the bug report also the issue is not just with count but with connect_volume (the chown part)\n\nMy reasoning is that the same lock mechanism is already working for detach, so with this it will be kind of symmetric, as attach and detach both manipulate the same host-local device path for a multiattach volumes. \nIn https://review.opendev.org/c/openstack/glance_store/+/962408 the disconnect_volume was put under the lock for the same reason (\"to include the attachment_delete call, we have to do disconnect here\"  https://review.opendev.org/c/openstack/glance_store/+/962408/6/glance_store/_drivers/cinder/store.py#768\n\nFor performance as I see we have to chose correctness (for the powerflex like drivers anyway) vs speed, so in this case I see this serialization as a must to make sure the attach mechanism also works well for all drivers.","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"33b40db1c79381ac078ea81895ff3d9abeb37858","unresolved":true,"context_lines":[{"line_number":924,"context_line":"            root_helper \u003d self.get_root_helper()"},{"line_number":925,"context_line":"            use_multipath \u003d self.store_conf.cinder_use_multipath"},{"line_number":926,"context_line":""},{"line_number":927,"context_line":"            attachment \u003d self.volume_api.attachment_create("},{"line_number":928,"context_line":"                client, volume_id, mode\u003dattach_mode)"},{"line_number":929,"context_line":"            LOG.debug(\u0027Attachment %(attachment_id)s created successfully.\u0027,"},{"line_number":930,"context_line":"                      {\u0027attachment_id\u0027: attachment[\u0027id\u0027]})"},{"line_number":931,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9f2463df_28c28318","line":928,"range":{"start_line":927,"start_character":0,"end_line":928,"end_character":52},"in_reply_to":"b270c8aa_9d845c84","updated":"2026-09-24 17:10:02.000000000","message":"thanks, let me check tomorrow your suggestion","commit_id":"b35d27b529b5779d2a074a3531b81ee2bc0a24e4"}]}
