mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 8768: merge fix in 2.2.2 to master
This commit is contained in:
parent
8f979ace70
commit
2f5bacf980
@ -559,7 +559,7 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe
|
||||
if(blockItems != null && blockItems.size() > 0) {
|
||||
for(SyncQueueItemVO item : blockItems) {
|
||||
if(item.getContentType().equalsIgnoreCase("AsyncJob"))
|
||||
completeAsyncJob(item.getContentId(), 2, 0, "Job is cancelled as it has been blocking others for too long");
|
||||
completeAsyncJob(item.getContentId(), 2, 0, getResetResultMessage("Job is cancelled as it has been blocking others for too long"));
|
||||
|
||||
// purge the item and resume queue processing
|
||||
_queueMgr.purgeItem(item.getId());
|
||||
@ -594,7 +594,7 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe
|
||||
Long jobId = item.getContentId();
|
||||
if(jobId != null) {
|
||||
s_logger.warn("Mark job as failed as its correspoding queue-item has been discarded. job id: " + jobId);
|
||||
completeAsyncJob(jobId, AsyncJobResult.STATUS_FAILED, 0, "Execution was cancelled because of server shutdown");
|
||||
completeAsyncJob(jobId, AsyncJobResult.STATUS_FAILED, 0, getResetResultMessage("Execution was cancelled because of server shutdown"));
|
||||
}
|
||||
}
|
||||
_queueMgr.purgeItem(item.getId());
|
||||
@ -663,7 +663,7 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe
|
||||
List<SyncQueueItemVO> items = _queueMgr.getActiveQueueItems(msHost.getId(), true);
|
||||
cleanupPendingJobs(items);
|
||||
_queueMgr.resetQueueProcess(msHost.getId());
|
||||
_jobDao.resetJobProcess(msHost.getId(), BaseCmd.INTERNAL_ERROR, getResetResultMessage());
|
||||
_jobDao.resetJobProcess(msHost.getId(), BaseCmd.INTERNAL_ERROR, getResetResultMessage("job cancelled because of management server restart"));
|
||||
txn.commit();
|
||||
} catch(Throwable e) {
|
||||
s_logger.warn("Unexpected exception ", e);
|
||||
@ -680,7 +680,7 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe
|
||||
List<SyncQueueItemVO> l = _queueMgr.getActiveQueueItems(getMsid(), false);
|
||||
cleanupPendingJobs(l);
|
||||
_queueMgr.resetQueueProcess(getMsid());
|
||||
_jobDao.resetJobProcess(getMsid(), BaseCmd.INTERNAL_ERROR, getResetResultMessage());
|
||||
_jobDao.resetJobProcess(getMsid(), BaseCmd.INTERNAL_ERROR, getResetResultMessage("job cancelled because of management server restart"));
|
||||
} catch(Throwable e) {
|
||||
s_logger.error("Unexpected exception " + e.getMessage(), e);
|
||||
}
|
||||
@ -693,10 +693,10 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe
|
||||
return true;
|
||||
}
|
||||
|
||||
private static String getResetResultMessage() {
|
||||
private static String getResetResultMessage(String messageText) {
|
||||
ExceptionResponse resultObject = new ExceptionResponse();
|
||||
resultObject.setErrorCode(BaseCmd.INTERNAL_ERROR);
|
||||
resultObject.setErrorText("job cancelled because of management server restart");
|
||||
resultObject.setErrorText(messageText);
|
||||
return ApiSerializerHelper.toSerializedStringOld(resultObject);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user