Skip to content

Commit 9eb5cef

Browse files
committed
Retry plugin call of cancel_coalesce_master in blktap2:_check_journal_coalesce_chain()
Signed-off-by: Arnaud Garcia-Fernandez <arnaud.garcia-fernandez@vates.tech>
1 parent c2660f9 commit 9eb5cef

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

drivers/blktap2.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,13 @@ def call_pluginhandler(cls, session, host_ref, sr_uuid, vdi_uuid, action,
15551555
util.logException("BLKTAP2:call_pluginhandler %s" % e)
15561556
return False
15571557

1558+
@util.xapi_safe_call
1559+
def _call_xapi_plugin(self, *args):
1560+
"""
1561+
wrapper to retry xenapi.host.call_plugin on XAPI HTTP failure.
1562+
"""
1563+
return self._session.xenapi.host.call_plugin(*args)
1564+
15581565
def _add_tag(self, vdi_uuid, writable):
15591566
util.SMlog("Adding tag to: %s" % vdi_uuid)
15601567
attach_mode = "RO"
@@ -1797,8 +1804,8 @@ def _check_journal_coalesce_chain(self, sr_uuid: str, vdi_uuid: str) -> bool:
17971804
host_ref = self._get_sr_master_host_ref()
17981805
for vdi in vdi_to_cancel:
17991806
args = {"sr_uuid": sr_uuid, "vdi_uuid": vdi}
1800-
util.SMlog("Calling cancel_coalesce_master with args: {}".format(args))
1801-
self._session.xenapi.host.call_plugin(\
1807+
util.SMlog(f"Calling cancel_coalesce_master with args: {args}")
1808+
self._call_xapi_plugin(
18021809
host_ref, PLUGIN_ON_SLAVE, "cancel_coalesce_master", args)
18031810

18041811
return True

0 commit comments

Comments
 (0)