diff --git a/deps/.classpath b/deps/.classpath index c86260dd4d4..6304bbe3659 100644 --- a/deps/.classpath +++ b/deps/.classpath @@ -1,54 +1,53 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/async/AsyncJobManagerImpl.java b/server/src/com/cloud/async/AsyncJobManagerImpl.java index ad6a30a9321..292174b0e1d 100644 --- a/server/src/com/cloud/async/AsyncJobManagerImpl.java +++ b/server/src/com/cloud/async/AsyncJobManagerImpl.java @@ -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,8 @@ 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 +664,8 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe List 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 +682,8 @@ public class AsyncJobManagerImpl implements AsyncJobManager, ClusterManagerListe List 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 +696,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); }