diff --git a/plugin/xinfini/src/main/java/org/zstack/xinfini/XInfiniApiHelper.java b/plugin/xinfini/src/main/java/org/zstack/xinfini/XInfiniApiHelper.java index b67bfa0da7e..10b93bbefb0 100644 --- a/plugin/xinfini/src/main/java/org/zstack/xinfini/XInfiniApiHelper.java +++ b/plugin/xinfini/src/main/java/org/zstack/xinfini/XInfiniApiHelper.java @@ -416,9 +416,20 @@ protected boolean onFailure(Throwable t) { private void retryUtilResourceDeleted(XInfiniRequest req, Class rsp) { + retryUtilResourceDeleted(req, rsp, 150, 2); + } + + private void retryUtilResourceDeleted(XInfiniRequest req, + Class rsp, + int retryTimes, + int retryInterval) { new Retry() { + { + times = retryTimes; + interval = retryInterval; + } + @Override - @RetryCondition(times = 150, interval = 2) protected Void call() { T r = XInfiniApiHelper.this.call(req, rsp); if (!r.resourceIsDeleted()) { @@ -731,7 +742,10 @@ public void deleteVolumeClientGroupMapping(int mapId) { GetVolumeClientGroupMappingRequest gReq = new GetVolumeClientGroupMappingRequest(); gReq.setId(mapId); - retryUtilResourceDeleted(gReq, GetVolumeClientGroupMappingResponse.class); + // the storage tears mappings down asynchronously path by path and cannot be + // operated on while deleting; observed taking over 30 minutes, so wait long + // enough to cover the teardown window + retryUtilResourceDeleted(gReq, GetVolumeClientGroupMappingResponse.class, 1800, 2); } public List queryIscsiGatewayClientGroupMappingByGroupId(int groupId) {