Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D6E5E17EDD for ; Mon, 14 Sep 2015 07:04:28 +0000 (UTC) Received: (qmail 19428 invoked by uid 500); 14 Sep 2015 07:04:28 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 19370 invoked by uid 500); 14 Sep 2015 07:04:28 -0000 Mailing-List: contact dev-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 dev@cloudstack.apache.org Received: (qmail 19359 invoked by uid 99); 14 Sep 2015 07:04:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2015 07:04:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 01BE1DFCE4; Mon, 14 Sep 2015 07:04:27 +0000 (UTC) From: karuturi To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-8827: Move the VM snapshots st... Content-Type: text/plain Message-Id: <20150914070428.01BE1DFCE4@git1-us-west.apache.org> Date: Mon, 14 Sep 2015 07:04:28 +0000 (UTC) Github user karuturi commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/793#discussion_r39365314 --- Diff: server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java --- @@ -1046,4 +1046,51 @@ private VmWorkJobVO createPlaceHolderWork(long instanceId) { return workJob; } + + @Override + public void cleanupVmSnapshotJobs(){ + List jobs = _jobMgr.findFailureAsyncJobs(VmWorkCreateVMSnapshot.class.getName(), VmWorkRevertToVMSnapshot.class.getName()); + + for (AsyncJobVO job : jobs) { + try { + if (job.getCmd().equalsIgnoreCase(VmWorkCreateVMSnapshot.class.getName())) { + VmWorkCreateVMSnapshot work = VmWorkSerializer.deserialize(VmWorkCreateVMSnapshot.class, job.getCmdInfo()); + cleanupVmSnapshotCreateFailure(work.getVmSnapshotId()); + } else if(job.getCmd().equalsIgnoreCase(VmWorkRevertToVMSnapshot.class.getName())) { + VmWorkRevertToVMSnapshot work = VmWorkSerializer.deserialize(VmWorkRevertToVMSnapshot.class, job.getCmdInfo()); + cleanupVmSnapshotRevertFailure(work.getVmSnapshotId()); + } + } catch (Exception e) { --- End diff -- what exception do you expect here? Is it the deserialization failure or any thing else? Can you catch specific exceptions? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---