Merge lp://staging/~chad.smith/charms/precise/block-storage-broker/bsb-retries-on-volume-create-and-attach into lp://staging/charms/block-storage-broker
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 56 | ||||
Proposed branch: | lp://staging/~chad.smith/charms/precise/block-storage-broker/bsb-retries-on-volume-create-and-attach | ||||
Merge into: | lp://staging/charms/block-storage-broker | ||||
Diff against target: |
217 lines (+78/-34) 3 files modified
hooks/test_hooks.py (+4/-4) hooks/test_util.py (+38/-13) hooks/util.py (+36/-17) |
||||
To merge this branch: | bzr merge lp://staging/~chad.smith/charms/precise/block-storage-broker/bsb-retries-on-volume-create-and-attach | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chad Smith (community) | Approve | ||
David Britton (community) | Needs Fixing | ||
Paul Larson | Pending | ||
Review via email: mp+231974@code.staging.launchpad.net |
Description of the change
To attempt to avoid spurious errors from openstack on nova volume-create and volume-attach commands, this branch adds a retry mechanism for those two commands run by the block storage broker.
This branch introduces an internal _run_command method to reunse retry and error handling logic around commands that are known to produce intermittent 500 errors.
_run_command attempts 3 retries on command failure and logs WARNINGs with each failed attempt. If the command fails 4 times in a row an ERROR is logged and we exit(1) to break the hook.
To keep this merge proposal smaller, we only use _run_command is only being used for "nova volume-create" and "nova volume-attach" methods. Subsequent branches will pull in other nova and euca2ools commands as we refine the error handling and retries needed.
[0] in _def_run_command(), why split the output into lines in a list? I think doing an rstrip() on the result would be enough..