You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/11/04 23:28:22 UTC

git commit: updated refs/heads/master to eb9cfff

Updated Branches:
  refs/heads/master 5ccf3a90a -> eb9cfffd2


Fix NPE due to race condition during system vm launch.


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

Branch: refs/heads/master
Commit: eb9cfffd246267bbb5fe4befeb9afeaaf366874a
Parents: 5ccf3a9
Author: Min Chen <mi...@citrix.com>
Authored: Mon Nov 4 14:26:42 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Mon Nov 4 14:27:04 2013 -0800

----------------------------------------------------------------------
 .../src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/eb9cfffd/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 86e49f9..5818aa8 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
@@ -453,6 +453,7 @@ public class VolumeServiceImpl implements VolumeService {
         } catch (Throwable e) {
             s_logger.debug("failed to create template on storage", e);
             templateOnPrimaryStoreObj.processEvent(Event.OperationFailed);
+            dataStore.create(template);  // make sure that template_spool_ref entry is still present so that the second thread can acquire the lock
             VolumeApiResult result = new VolumeApiResult(volume);
             result.setResult(e.toString());
             future.complete(result);