summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2013-06-22 23:07:33 +0000
committerChris Behrens <cbehrens@codestud.com>2013-06-23 02:13:06 +0000
commitee1accfe0328c648344cc59b7b54302ba9a687f0 (patch)
tree2670c56160154af3df6d3e2f1d2514b83abccf91 /plugins
parentcefb0510b8f12dab17126907661d82094c31741d (diff)
downloadnova-ee1accfe0328c648344cc59b7b54302ba9a687f0.tar.gz
nova-ee1accfe0328c648344cc59b7b54302ba9a687f0.tar.xz
nova-ee1accfe0328c648344cc59b7b54302ba9a687f0.zip
Fix xenstore-rm race condition
If an entry is already gone from xenstore, any other xenstore-rm will raise. When we make calls to nova-agent, we wait for the response in Xenstore. After a timeout period, we attempt to remove it. If the DomID has changed (due to a Windows VM rebooting at the right time via sysprep, etc)... or if the agent picked up the command and didn't respond in a timely fashion, the removal attempt will fail. It would be normal for the entry to be gone in this case. This fixes the plugin to ignore when the entry is already deleted. Fixes bug 1193720 Change-Id: I8585a9f147cad3c5abe531620872b475eb4128c9
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py
index 9c86b7cb7..a12704248 100755
--- a/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py
+++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/xenstore.py
@@ -159,7 +159,13 @@ def delete_record(self, arg_dict):
VM and the specified path from xenstore.
"""
cmd = ["xenstore-rm", "/local/domain/%(dom_id)s/%(path)s" % arg_dict]
- ret, result = _run_command(cmd)
+ try:
+ ret, result = _run_command(cmd)
+ except XenstoreError, e:
+ if 'could not remove path' in e.stderr:
+ # Entry already gone. We're good to go.
+ return ''
+ raise
return result