Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 85BED10927 for ; Tue, 23 Jul 2013 00:14:39 +0000 (UTC) Received: (qmail 40117 invoked by uid 500); 23 Jul 2013 00:14:39 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 40101 invoked by uid 500); 23 Jul 2013 00:14:39 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 40094 invoked by uid 99); 23 Jul 2013 00:14:39 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 00:14:39 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 278BC8B1537; Tue, 23 Jul 2013 00:14:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: commits@cloudstack.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 181fb03 Date: Tue, 23 Jul 2013 00:14:39 +0000 (UTC) Updated Branches: refs/heads/master 7974dfe8d -> 181fb03e7 CLOUDSTACK-3716:NPE triggered in DownloadListener Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/181fb03e Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/181fb03e Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/181fb03e Branch: refs/heads/master Commit: 181fb03e7e6ed89102a8b5f0acfddf88d148d55c Parents: 7974dfe Author: Min Chen Authored: Mon Jul 22 17:12:02 2013 -0700 Committer: Min Chen Committed: Mon Jul 22 17:14:30 2013 -0700 ---------------------------------------------------------------------- .../org/apache/cloudstack/storage/volume/VolumeServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/181fb03e/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 9338d38..3b544b1 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 @@ -1045,6 +1045,11 @@ public class VolumeServiceImpl implements VolumeService { List toBeDownloaded = new ArrayList(dbVolumes); for (VolumeDataStoreVO volumeStore : dbVolumes) { VolumeVO volume = _volumeDao.findById(volumeStore.getVolumeId()); + if (volume == null ){ + s_logger.warn("Volume_store_ref shows that volume " + volumeStore.getVolumeId() + " is on image store " + storeId + + ", but the volume is not found in volumes table, potentially some bugs in deleteVolume, so we just treat this volume to be deleted"); + continue; + } // Exists then don't download if (volumeInfos.containsKey(volume.getId())) { TemplateProp volInfo = volumeInfos.remove(volume.getId());