From c5206fe3ecedf361cd80dbab5635ba09ed35dc5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=8D=EC=9D=B8=EC=9A=A9?= Date: Tue, 21 Jan 2025 20:33:00 +0900 Subject: [PATCH] Avoid conflicting update of provisioned_capacity_gb While checking the capacity filter, it was found that the provisioned_capacity_gb value was instantaneously initialized to None in another thread, so Added synchronized lock to avoid conflicting update. Closes-Bug: #1871768 Change-Id: If3b1d3077e3018de79c782886f231184840f7086 Signed-off-by: Goutham Pacha Ravi --- manila/scheduler/host_manager.py | 1 + ...-provisioned_capaciti_gb-is_None-d700c0544a8a88e8.yaml | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 releasenotes/notes/fix-issue-about-provisioned_capaciti_gb-is_None-d700c0544a8a88e8.yaml diff --git a/manila/scheduler/host_manager.py b/manila/scheduler/host_manager.py index 286c0fb584..9bb3f40d3b 100644 --- a/manila/scheduler/host_manager.py +++ b/manila/scheduler/host_manager.py @@ -455,6 +455,7 @@ class PoolState(HostState): provisioned_capacity += instance['size'] or 0 return provisioned_capacity + @utils.synchronized("update_from_share_capability") def update_from_share_capability( self, capability, service=None, context=None): """Update information about a pool from its share_node info.""" diff --git a/releasenotes/notes/fix-issue-about-provisioned_capaciti_gb-is_None-d700c0544a8a88e8.yaml b/releasenotes/notes/fix-issue-about-provisioned_capaciti_gb-is_None-d700c0544a8a88e8.yaml new file mode 100644 index 0000000000..d3550a02eb --- /dev/null +++ b/releasenotes/notes/fix-issue-about-provisioned_capaciti_gb-is_None-d700c0544a8a88e8.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Added synchronized lock to fix issue where provisioned_capacity_gb value + was initialized to None immediately on another thread while checking + capacity filter, causing shared creation to fail due to conflicting + provisioned_capacity_gb updates. + please refer to `launchpad bug #1871768 `_.