Skip to content

Commit

Permalink
slicer endpoint should not hang on new slicer creation resolves #659 … (
Browse files Browse the repository at this point in the history
#667)

* slicer endpoint should not hang on new slicer creation resolves #659 #589

* updated api error handling

* fixed size issue on slicer query
  • Loading branch information
jsnoble authored and kstaken committed Feb 27, 2018
1 parent 25c9a3e commit 5fc34f1
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 171 deletions.
15 changes: 8 additions & 7 deletions lib/cluster/execution_controller/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ module.exports = function module(context, messaging, exStore, stateStore, execut
function _terminalError(err) {
const errMsg = parseError(err);
const executionStats = executionAnalytics.getAnalytics();
const errorMeta = exStore.failureMetaData(errMsg, executionStats);
const errorMeta = exStore.executionMetaData(executionStats, errMsg);
logger.error(errMsg);

exStore.setStatus(exId, 'failed', errorMeta)
Expand Down Expand Up @@ -353,7 +353,7 @@ module.exports = function module(context, messaging, exStore, stateStore, execut
isProcessing = false;
const errMsg = `slicer for ex ${exId} had an error, shutting down execution ${parseError(err)}`;
const executionStats = executionAnalytics.getAnalytics();
const errorMeta = exStore.failureMetaData(errMsg, executionStats);
const errorMeta = exStore.executionMetaData(executionStats, errMsg);
logger.error(errMsg);

exStore.setStatus(exId, 'failed', errorMeta)
Expand Down Expand Up @@ -479,9 +479,10 @@ module.exports = function module(context, messaging, exStore, stateStore, execut
}

function _setFailingStatus() {
logger.error(`slicer: ${exId} has encountered a processing_error`);
const errMsg = `slicer: ${exId} has encountered a processing_error`;
logger.error(errMsg);
const executionStats = executionAnalytics.getAnalytics();
const errorMeta = exStore.failureMetaData(null, executionStats);
const errorMeta = exStore.executionMetaData(executionStats, errMsg);
exStore.setStatus(exId, 'failing', errorMeta);
}

Expand All @@ -491,7 +492,7 @@ module.exports = function module(context, messaging, exStore, stateStore, execut
if (checkFn()) {
logger.error(logMsg);
const executionStats = executionAnalytics.getAnalytics();
const errorMetaData = exStore.failureMetaData(errMsg, executionStats);
const errorMetaData = exStore.executionMetaData(executionStats, errMsg);
exStore.setStatus(exId, 'failed', errorMetaData)
.then(() => {
messaging.send({
Expand Down Expand Up @@ -565,12 +566,12 @@ module.exports = function module(context, messaging, exStore, stateStore, execut

if (errCount > 0) {
const message = `execution: ${exId} had ${errCount} slice failures during processing`;
const errorMeta = exStore.failureMetaData(message, executionStats);
const errorMeta = exStore.executionMetaData(executionStats, message);
logger.error(message);
exStore.setStatus(exId, 'failed', errorMeta);
} else {
logger.info(`execution ${exId} has completed`);
const metaData = exStore.failureMetaData(false, executionStats);
const metaData = exStore.executionMetaData(executionStats);
exStore.setStatus(exId, 'completed', metaData);
}
messaging.send(msg);
Expand Down
2 changes: 1 addition & 1 deletion lib/cluster/execution_controller/recovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function module(context, messaging, executionAnalytics, exStore
function _recoveryFailure(_errMsg) {
const errMsg = _errMsg.error || _errMsg;
const slicerAnalytics = executionAnalytics.getAnalytics();
const errorMeta = exStore.failureMetaData(errMsg, slicerAnalytics);
const errorMeta = exStore.executionMetaData(slicerAnalytics, errMsg);
logger.error(errMsg);

exStore.setStatus(exId, 'failed', errorMeta)
Expand Down
Loading

0 comments on commit 5fc34f1

Please sign in to comment.