diff options
author | whoami-rajat <rajatdhasmana@gmail.com> | 2020-04-01 14:18:44 +0000 |
---|---|---|
committer | Rajat Dhasmana <rajatdhasmana@gmail.com> | 2020-05-01 11:35:01 +0000 |
commit | f5d46996139593f6249138bcc9f09b6120f0034a (patch) | |
tree | cf51b33ee3f7505666c3a4f1d2297270080877d8 /glance_store/exceptions.py | |
parent | 2aa892d4dfb1cf8beb5f9bdba4e468486d4bae44 (diff) | |
download | glance_store-f5d46996139593f6249138bcc9f09b6120f0034a.tar.gz |
Add lock per share for cinder nfs mount/umount
With cinder configured as glance store and nfs as cinder backend,
if we create multiple images concurrently into the same share,
there might be race conditions.
This patch ensures a lock per export to avoid the race conditions.
This patch also introduces a reference counting mechamism for unmounting
which will unmount the share if no active thread/process is using it.
Closes-Bug: #1870289
Change-Id: I9197f64e29a0ae2e0a58186f1a70aa134f7f1db6
Diffstat (limited to 'glance_store/exceptions.py')
-rw-r--r-- | glance_store/exceptions.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/glance_store/exceptions.py b/glance_store/exceptions.py index a20440f..99bc1b0 100644 --- a/glance_store/exceptions.py +++ b/glance_store/exceptions.py @@ -181,3 +181,8 @@ class HasSnapshot(GlanceStoreException): class InUseByStore(GlanceStoreException): message = _("The image cannot be deleted because it is in use through " "the backend store outside of Glance.") + + +class HostNotInitialized(GlanceStoreException): + message = _("The glance cinder store host %(host)s which will used to " + "perform nfs mount/umount operations isn't initialized.") |