]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
vmware: Fix problems with VIM API retry logic
authorVipin Balachandran <vbala@vmware.com>
Wed, 16 Apr 2014 08:36:31 +0000 (14:06 +0530)
committerVipin Balachandran <vbala@vmware.com>
Wed, 16 Apr 2014 09:30:52 +0000 (15:00 +0530)
commitbc115eaa477d30826ac17986a6e45844b456e206
tree0c191cd30c352027385526b638f368fb7e8a1451
parentd7d2599de95d60380081964213c1e9e19926a23a
vmware: Fix problems with VIM API retry logic

Currently the VIM APIs including session creation API are retried for
cases which are unrelated to connection or session overload problems.
This change fix the retry logic as follows:
* Add an exception to indicate connection problem and raise it
  appropriately from the VIM API client
* Modify the expected exceptions in the retry decorator to include
  only connection and session overload related exceptions

This change also fixes the base class of VimFaultException
(VolumeBackendAPIException -> VimException). This change is required
so that we can handle the exceptions thrown by the VIM API client in
a consistent manner. Currently if we need to handle VIM API related
exceptions, we have to catch both VimException and VimFaultException.
For example, the API for checking active session raises
VimFaultException in some cases and we are handling only VimException.
Due to this, when session expires, the session re-establishment and API
retry fails (intermittently) since the check for active session throws
VimFaultException in some cases which is not handled.

Change-Id: I72cfc7777c3ce693b8598633f822c12c2cee2235
Closes-Bug: #1294598
Closes-Bug: #1302514
cinder/tests/test_vmware_api.py
cinder/volume/drivers/vmware/api.py
cinder/volume/drivers/vmware/error_util.py
cinder/volume/drivers/vmware/vim.py