"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "manila/share/drivers/zfsonlinux/driver.py" between
manila-11.0.0.tar.gz and manila-11.0.1.tar.gz

About: OpenStack Manila provides “Shared Filesystems as a service”.
The "Victoria" series (latest release).

driver.py  (manila-11.0.0):driver.py  (manila-11.0.1)
skipping to change at line 272 skipping to change at line 272
LOG.debug("Cannot destroy dataset '%(name)s', it has " LOG.debug("Cannot destroy dataset '%(name)s', it has "
"opened files. Will wait 2 more seconds. " "opened files. Will wait 2 more seconds. "
"Out: \n%(out)s", { "Out: \n%(out)s", {
'name': name, 'out': out}) 'name': name, 'out': out})
time.sleep(2) time.sleep(2)
else: else:
raise exception.ZFSonLinuxException( raise exception.ZFSonLinuxException(
msg=_("Could not destroy '%s' dataset, " msg=_("Could not destroy '%s' dataset, "
"because it had opened files.") % name) "because it had opened files.") % name)
# NOTE(vponomaryov): Now, when no file usages and mounts of dataset @utils.retry(exception.ProcessExecutionError)
# exist, destroy dataset. def _zfs_destroy_with_retry():
try: """Retry destroying dataset ten times with exponential backoff."""
self.zfs('destroy', '-f', name) # NOTE(bswartz): There appears to be a bug in ZFS when creating and
return # destroying datasets concurrently where the filesystem remains
except exception.ProcessExecutionError: # mounted even though ZFS thinks it's unmounted. The most reliable
LOG.info("Failed to destroy ZFS dataset, retrying one time") # workaround I've found is to force the unmount, then attempt the
# destroy, with short pauses around the unmount. (See bug#1546723)
try:
self.execute('sudo', 'umount', mountpoint)
except exception.ProcessExecutionError:
# Ignore failed umount, it's normal
pass
time.sleep(2)
# NOTE(bswartz): There appears to be a bug in ZFS when creating and # NOTE(vponomaryov): Now, when no file usages and mounts of dataset
# destroying datasets concurrently where the filesystem remains mounted # exist, destroy dataset.
# even though ZFS thinks it's unmounted. The most reliable workaround self.zfs('destroy', '-f', name)
# I've found is to force the unmount, then retry the destroy, with
# short pauses around the unmount.
time.sleep(1)
try:
self.execute('sudo', 'umount', mountpoint)
except exception.ProcessExecutionError:
# Ignore failed umount, it's normal
pass
time.sleep(1)
# This time the destroy is expected to succeed. _zfs_destroy_with_retry()
self.zfs('destroy', '-f', name)
def _setup_helpers(self): def _setup_helpers(self):
"""Setups share helper for ZFS backend.""" """Setups share helper for ZFS backend."""
self._helpers = {} self._helpers = {}
helpers = self.configuration.zfs_share_helpers helpers = self.configuration.zfs_share_helpers
if helpers: if helpers:
for helper_str in helpers: for helper_str in helpers:
share_proto, __, import_str = helper_str.partition('=') share_proto, __, import_str = helper_str.partition('=')
helper = importutils.import_class(import_str) helper = importutils.import_class(import_str)
self._helpers[share_proto.upper()] = helper( self._helpers[share_proto.upper()] = helper(
 End of changes. 3 change blocks. 
21 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)