history.setErrorMessage(error.getStackTraceString()); } else { history.setErrorMessage("Operation was canceled at " + new Date(completionTime));
history.setErrorMessage(error.getStackTraceString()); } else { history.setErrorMessage("Failed for an unknown reason at " + new Date(completionTime));
public void operationSucceeded(String jobId, Configuration result, long invocationTime, long completionTime) { LOG.debug("Operation invocation [" + jobId + "] succeeded " + getFromStartToEndTimestampString(invocationTime, completionTime)); try { Subject superuser = LookupUtil.getSubjectManager().getOverlord(); OperationManagerLocal operationManager = LookupUtil.getOperationManager(); ResourceOperationHistory history; history = (ResourceOperationHistory) operationManager.getOperationHistoryByJobId(superuser, jobId); // I think this will only ever occur if the server-side timed this out but the long running // operation finally got back to us afterwards. We will still go ahead and // persist the success data because, obviously, the operation really didn't time out. // I think, in reality, this condition will never occur (since the server-side will only ever // timeout ridiculously long-lived operations, which is typically only when an agent shutdown occurred). if (history.getStatus() != OperationRequestStatus.INPROGRESS) { LOG.debug("Was told an operation succeeded but, curiously, it was not in progress: " + "job-id=[" + jobId + "], op-history=[" + history + "]"); } history.setErrorMessage(null); history.setResults(result); history.setStatus(OperationRequestStatus.SUCCESS); operationManager.updateOperationHistory(superuser, history); operationManager.checkForCompletedGroupOperation(history.getId()); } catch (Exception e) { LOG.error("Failed to update history from successful operation, jobId=[" + jobId + "]. Cause: " + e, e); LOG.error("The successful operation [" + jobId + "] had results of: " + result); } }
history.setErrorMessage("Timed out : did not complete after " + duration + " ms" + " (the timeout period was " + timeout + " ms)"); } else { history.setErrorMessage("Failed to start : operation never started");
composite.history.setErrorMessage("This has been cancelled due to halt-on-error " + "being set on the parent group operation schedule. " + "A previous resource operation that executed prior "
} catch (Exception e) { resourceHistory.setErrorMessage(ThrowableUtil.getStackAsString(e)); operationManager.updateOperationHistory(s, resourceHistory); operationManager.checkForCompletedGroupOperation(resourceHistory.getId());