Skip to content

Commit

Permalink
Handle ECONNREFUSED exception in SolidFire driver.
Browse files Browse the repository at this point in the history
The SolidFire driver wasn't handling connection exceptions
during init (capacity updates from scheduler).

This patch add a try/except wrap around the two places
that this is called and logs and error rather than crashing
cinder-volume service.

Fixes bug: 1195910

Change-Id: I30347cc0973bbf9dbc30ea02e204560095fc75b4
(cherry picked from commit d596bfe)
  • Loading branch information
j-griffith authored and vishvananda committed Jul 2, 2013
1 parent 7a15827 commit e58cac5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions cinder/volume/drivers/solidfire.py
Expand Up @@ -77,7 +77,12 @@ class SolidFire(SanISCSIDriver):
def __init__(self, *args, **kwargs):
super(SolidFire, self).__init__(*args, **kwargs)
self.configuration.append_config_values(sf_opts)
self._update_cluster_status()
try:
self._update_cluster_status()
except Exception as ex:
LOG.error(_("Update SolidFire Cluster stats failed: %s"),
ex.strerror)
pass

def _issue_api_request(self, method_name, params):
"""All API requests to SolidFire device go through this method.
Expand Down Expand Up @@ -555,7 +560,12 @@ def get_volume_stats(self, refresh=False):
data
"""
if refresh:
self._update_cluster_status()
try:
self._update_cluster_status()
except Exception as ex:
LOG.error(_("Update SolidFire Cluster stats failed: %s"),
ex.strerror)
pass

return self.cluster_stats

Expand Down

0 comments on commit e58cac5

Please sign in to comment.