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<AsyncJobVO> 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. ---