You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "sureshanaparti (via GitHub)" <gi...@apache.org> on 2025/06/05 09:01:17 UTC
Re: [PR] Fix infrastructure leak on exception while attaching/detaching volumes in VMware [cloudstack]
sureshanaparti commented on code in PR #10860:
URL: https://github.com/apache/cloudstack/pull/10860#discussion_r2128325087
##########
server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java:
##########
@@ -4657,6 +4660,11 @@ private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volumeToAttach, L
try {
answer = (AttachAnswer)_agentMgr.send(hostId, cmd);
+ } catch (AgentUnavailableException e) {
+ if (host != null) {
+ volService.revokeAccess(volFactory.getVolume(volumeToAttach.getId()), host, dataStore);
+ }
+ throw new CloudRuntimeException(String.format("%s. Please, contact your system administrator", errorMsg));
Review Comment:
```suggestion
throw new CloudRuntimeException(String.format("%s. Please contact your system administrator", errorMsg));
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org