Fixes to handle 404 exceptions when export policy and ontap volume ar…#73
Fixes to handle 404 exceptions when export policy and ontap volume ar…#73sandeeplocharla wants to merge 3 commits into
Conversation
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
f94975a to
5aab5f7
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves resilience of the ONTAP storagepool delete workflow by treating ONTAP “404 Not Found” responses as a no-op when attempting to delete already-missing export policies and volumes, reducing avoidable failures/noise during cleanup.
Changes:
- Handle
FeignExceptionwith HTTP 404 for export policy deletion (NAS) as a no-op. - Handle
FeignExceptionwith HTTP 404 for volume deletion as a no-op. - Minor import reordering/cleanup in the touched classes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/UnifiedNASStrategy.java | Treats 404 during export policy deletion as a no-op to avoid failing storagepool deletion when the policy is already missing. |
| plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/service/StorageStrategy.java | Treats 404 during volume deletion as a no-op to avoid failing cleanup when the volume is already missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } catch (FeignException e) { | ||
| if (e.status() == 404) { | ||
| logger.warn("deleteAccessGroup: Export policy '{}' not found in ONTAP, treating as no-op", exportPolicyName); | ||
| return; | ||
| } |
| } catch (FeignException e) { | ||
| if (e.status() == 404) { | ||
| logger.warn("deleteStorageVolume: Volume '{}' not found in ONTAP, treating as no-op", volume.getName()); | ||
| return; | ||
| } |
There was a problem hiding this comment.
I think we should resolve this comment.
5aab5f7 to
c5ec5b2
Compare
| logger.error("deleteAccessGroup: Failed to delete export policy. Exception: {}", e.getMessage(), e); | ||
| throw new CloudRuntimeException("Failed to delete export policy: " + e.getMessage(), e); | ||
|
|
||
| } | ||
| } catch (Exception e) { | ||
| logger.error("deleteAccessGroup: Failed to delete export policy. Exception: {}", e.getMessage(), e); |
| } | ||
| logger.info("Volume deleted successfully: " + volume.getName()); | ||
| } catch (FeignException.FeignClientException e) { | ||
| } catch (FeignException e) { |
| } catch (FeignException e) { | ||
| if (e.status() == 404) { | ||
| logger.warn("deleteStorageVolume: Volume '{}' not found in ONTAP, treating as no-op", volume.getName()); | ||
| return; | ||
| } |
There was a problem hiding this comment.
I think we should resolve this comment.
Fixes to handle 404 exceptions when export policy and ontap volume are missing during storagepool delete workflow
Description
This PR...
Has fixes to handle 404 Not found exceptions in case of 'ExportPolicy' and 'Volume' deletion.
Screenshots (if appropriate):
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
How did you try to break this feature and the system with this change?