CLOUDSTACK-9195: Cancelled/failed async jobs not getting cleaned up from DB

Setting 'job_complete_msid' field in async_job table when marking job as cancelled during MS restart.
This will ensure that the job is cleaned up as part of GC thread.
This commit is contained in:
Koushik Das 2015-12-22 13:53:29 +05:30
parent 7e12ebf280
commit a6f9181ee1
1 changed files with 1 additions and 0 deletions

View File

@ -1006,6 +1006,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
job.setStatus(JobInfo.Status.FAILED);
job.setResultCode(ApiErrorCode.INTERNAL_ERROR.getHttpCode());
job.setResult("job cancelled because of management server restart or shutdown");
job.setCompleteMsid(msid);
_jobDao.update(job.getId(), job);
if (s_logger.isDebugEnabled()) {
s_logger.debug("Purge queue item for cancelled job-" + job.getId());