cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/master to 81fedcf
Date Thu, 15 Aug 2013 01:16:25 GMT
Updated Branches:
  refs/heads/master c675f826e -> 81fedcfa3


CLOUDSTACK-4338: catch up exception in case of deleting volume in parallel: it's possible
that two threads can delete one volume at the same time, if the volume state is in Expunging


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/81fedcfa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/81fedcfa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/81fedcfa

Branch: refs/heads/master
Commit: 81fedcfa3e0f21551e81220535497e6d00853d29
Parents: c675f82
Author: Edison Su <sudison@gmail.com>
Authored: Wed Aug 14 18:14:05 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Aug 14 18:16:08 2013 -0700

----------------------------------------------------------------------
 .../storage/volume/VolumeServiceImpl.java       | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81fedcfa/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index f5af4bb..5600ac7 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -292,15 +292,19 @@ public class VolumeServiceImpl implements VolumeService {
         CommandResult result = callback.getResult();
         VolumeObject vo = context.getVolume();
         VolumeApiResult apiResult = new VolumeApiResult(vo);
-        if (result.isSuccess()) {
-            vo.processEvent(Event.OperationSuccessed);
-            if (canVolumeBeRemoved(vo.getId())) {
-                s_logger.info("Volume " + vo.getId() + " is not referred anywhere, remove
it from volumes table");
-                volDao.remove(vo.getId());
+        try {
+            if (result.isSuccess()) {
+                vo.processEvent(Event.OperationSuccessed);
+                if (canVolumeBeRemoved(vo.getId())) {
+                    s_logger.info("Volume " + vo.getId() + " is not referred anywhere, remove
it from volumes table");
+                    volDao.remove(vo.getId());
+                }
+            } else {
+                vo.processEvent(Event.OperationFailed);
+                apiResult.setResult(result.getResult());
             }
-        } else {
-            vo.processEvent(Event.OperationFailed);
-            apiResult.setResult(result.getResult());
+        } catch (Exception e) {
+           s_logger.debug("ignore delete volume status update failure, it will be picked
up by storage clean up thread later", e);
         }
         context.getFuture().complete(apiResult);
         return null;


Mime
View raw message