You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ra...@apache.org on 2017/02/28 00:30:21 UTC

[2/2] git commit: updated refs/heads/master to 6a18cdd

Merge pull request #1825 from Accelerite/CLOUDSTACK-9660

CLOUDSTACK-9660: NPE while destroying volumes during 1000 VMs deploy and destroy tests

NPE is seen as VM destroy and storage cleanup threads try to remove the same root volume. Fix is to handle
only non-root volumes in storage cleanup thread, root volumes will be handled as part of VM destroy.

* pr/1825:
  CLOUDSTACK-9660: NPE while destroying volumes during 1000 VMs deploy and destroy tests NPE is seen as VM destroy and storage cleanup threads try to remove the same root volume. Fix is to handle only non-root volumes in storage cleanup thread, root volumes will be handled as part of VM destroy.

Signed-off-by: Rajani Karuturi <ra...@accelerite.com>


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

Branch: refs/heads/master
Commit: 6a18cdd6ef969cca3a063356d4a9a68163b5ff6e
Parents: 017c42b d6b41d9
Author: Rajani Karuturi <ra...@accelerite.com>
Authored: Tue Feb 28 06:00:02 2017 +0530
Committer: Rajani Karuturi <ra...@accelerite.com>
Committed: Tue Feb 28 06:00:02 2017 +0530

----------------------------------------------------------------------
 engine/schema/src/com/cloud/storage/dao/VolumeDao.java   |  2 +-
 .../schema/src/com/cloud/storage/dao/VolumeDaoImpl.java  |  4 +++-
 .../apache/cloudstack/storage/volume/VolumeObject.java   |  7 ++++---
 .../cloudstack/storage/volume/VolumeServiceImpl.java     |  5 +++++
 server/src/com/cloud/storage/StorageManagerImpl.java     | 11 ++++++++---
 5 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a18cdd6/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --cc engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index eef61a2,0b58bf2..2e72286
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@@ -316,8 -316,15 +316,13 @@@ public class VolumeServiceImpl implemen
          }
  
          VolumeVO vol = volDao.findById(volume.getId());
+         if (vol == null) {
+             s_logger.debug("Volume " + volume.getId() + " is not found");
+             future.complete(result);
+             return future;
+         }
  
 -        String volumePath = vol.getPath();
 -        Long poolId = vol.getPoolId();
 -        if (poolId == null || volumePath == null || volumePath.trim().isEmpty()) {
 +        if (!volumeExistsOnPrimary(vol)) {
              // not created on primary store
              if (volumeStore == null) {
                  // also not created on secondary store

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6a18cdd6/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------