Github user anshul1886 commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/793#discussion_r39367811 --- 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 -- Basically I don't care about specific exception I am getting here and in any case of exception I will continue. That's why I am catching generic exception and logging the specific exception in logs for debugging purposes.
--- 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. ---