diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-09-30 21:10:37 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-09-30 21:10:37 +0000 |
commit | 4ea962bb26edecaf1380698491fd34028e2e0535 (patch) | |
tree | a44e48942238622ce13ecceb111845092a8bb304 | |
parent | 08b2bc1b2aa622a90dbd2de3b265ee62dc57d7f2 (diff) | |
parent | 1654031cc6b0fa28efb322717efabf2bebffabf8 (diff) | |
download | trove-4ea962bb26edecaf1380698491fd34028e2e0535.tar.gz |
Merge "Use different timeouts for create and restore"
-rw-r--r-- | etc/trove/trove-taskmanager.conf.sample | 2 | ||||
-rw-r--r-- | trove/common/cfg.py | 3 | ||||
-rwxr-xr-x | trove/taskmanager/models.py | 7 |
3 files changed, 9 insertions, 3 deletions
diff --git a/etc/trove/trove-taskmanager.conf.sample b/etc/trove/trove-taskmanager.conf.sample index 89f43426..25b066e4 100644 --- a/etc/trove/trove-taskmanager.conf.sample +++ b/etc/trove/trove-taskmanager.conf.sample @@ -7,6 +7,8 @@ debug = True # Update the service and instance statuses if the instances fails to become # active within the configured usage_timeout. +# usage_timeout = 600 +# restore_usage_timeout = 36000 update_status_on_fail = True # The RabbitMQ broker address where a single node is used. diff --git a/trove/common/cfg.py b/trove/common/cfg.py index d627c250..69e34d5d 100644 --- a/trove/common/cfg.py +++ b/trove/common/cfg.py @@ -364,6 +364,9 @@ common_opts = [ cfg.IntOpt('usage_timeout', default=600, help='Maximum time (in seconds) to wait for a Guest to become ' 'active.'), + cfg.IntOpt('restore_usage_timeout', default=36000, + help='Maximum time (in seconds) to wait for a Guest instance ' + 'restored from a backup to become active.'), cfg.IntOpt('cluster_usage_timeout', default=675, help='Maximum time (in seconds) to wait for a cluster to ' 'become active.'), diff --git a/trove/taskmanager/models.py b/trove/taskmanager/models.py index d9934698..6360608a 100755 --- a/trove/taskmanager/models.py +++ b/trove/taskmanager/models.py @@ -297,10 +297,11 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin): # record to avoid over billing a customer for an instance that # fails to build properly. try: - usage_timeout = CONF.usage_timeout + timeout = (CONF.restore_usage_timeout if backup_info + else CONF.usage_timeout) utils.poll_until(self._service_is_active, sleep_time=USAGE_SLEEP_TIME, - time_out=usage_timeout) + time_out=timeout) LOG.info(_("Created instance %s successfully.") % self.id) self.send_usage_event('create', instance_size=flavor['ram']) except PollTimeOut: @@ -357,7 +358,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin): "from instance %(source)s " "for new replica %(replica)s.") % {'source': slave_of_id, 'replica': self.id}) - err = inst_models.InstanceTasks.BUILDING_ERROR_SLAVE + err = inst_models.InstanceTasks.BUILDING_ERROR_REPLICA Backup.delete(context, snapshot_info['id']) self._log_and_raise(e, msg, err) except Exception: |