diff --git a/planb/default_settings.py b/planb/default_settings.py index 3da44a8..ff62f6f 100644 --- a/planb/default_settings.py +++ b/planb/default_settings.py @@ -109,10 +109,10 @@ Q_MAIN_QUEUE = 'main' Q_CLUSTER_QUEUE = os.environ.get('Q_CLUSTER_QUEUE', Q_MAIN_QUEUE) -# The worker queue for dutree tasks, limited to 1 worker. See how this is set +# The worker queue for dutree tasks, limited to 3 workers. See how this is set # in the bqcluster management command. Q_DUTREE_QUEUE = 'dutree' -Q_DUTREE_WORKERS = 1 +Q_DUTREE_WORKERS = 3 Q_CLUSTER = { 'name': 'planb', # redis prefix AND default broker (yuck!) diff --git a/planb/storage/zfs.py b/planb/storage/zfs.py index 7d74678..b2f8add 100644 --- a/planb/storage/zfs.py +++ b/planb/storage/zfs.py @@ -26,6 +26,21 @@ logger = logging.getLogger(__name__) +class WorkonFailure(Exception): + pass + + +class LocalFilesetMissing(WorkonFailure): + """Expected storage "fileset" was not found""" + pass + + +class LocalMountFailure(WorkonFailure): + """Expected storage "fileset+snapshot" mount failed""" + # (maybe the snapshot doesn't exist) + pass + + class PerformCommands: @classmethod def ensure_defaults(cls, config): @@ -490,8 +505,8 @@ def begin_work(self, data_path=None): break else: # No luck after the Nth attempt. Fail. - raise ValueError('Failed to work on {!r} ({})'.format( - path, self.name)) # FIXME: better exception + raise LocalMountFailure('Failed to work on {!r} ({})'.format( + path, self.name)) def end_work(self): # Leave directory, so it can be unmounted. @@ -519,7 +534,7 @@ def get_data_path(self): if not hasattr(self, '_get_data_path'): local_path = self.get_mount_path() if not local_path: - raise ValueError( + raise LocalFilesetMissing( 'path {!r} for {!r} does not exist'.format( local_path, self.name)) self._get_data_path = os.path.join(local_path, 'data')