diff options
author | Oleg Mitsura <oleg.mitsura@amdocs.com> | 2020-06-18 08:57:22 -0400 |
---|---|---|
committer | Oleg Mitsura <oleg.mitsura@amdocs.com> | 2020-06-18 10:18:28 -0400 |
commit | 5541cbbe066c31cac53f197fcb1bc658c0f3b0d2 (patch) | |
tree | 10dbe78a7ef37beaaa6ffe8a75f9fb3714eb7c80 /ms/blueprintsprocessor/functions/python-executor | |
parent | cec8ff4951b9c045e84dd6d08d898b78c723d2e5 (diff) |
Missing note of timeout differences.
rev1. initial commit
rev2. spacing (silly klint!)
Issue-ID: CCSDK-2445
Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com>
Change-Id: Ie8cc62c89e212efbf5240304856b79c173c88abb
Diffstat (limited to 'ms/blueprintsprocessor/functions/python-executor')
-rw-r--r-- | ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt index d4c8841a8..848647405 100644 --- a/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt +++ b/ms/blueprintsprocessor/functions/python-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/python/executor/ComponentRemotePythonExecutor.kt @@ -123,6 +123,9 @@ open class ComponentRemotePythonExecutor( val executionTimeout = getOptionalOperationInput(INPUT_EXECUTE_TIMEOUT)?.asInt() ?: DEFAULT_EXECUTE_TIMEOUT_IN_SEC + // set the component level timeout as envPrepTimeout + executionTimeout (small delta will be applied in AbstractComponentFunction + val timeout = envPrepTimeout + executionTimeout + var scriptCommand = command.replace(pythonScript.name, pythonScript.absolutePath) if (args != null && args.isNotEmpty()) { scriptCommand = scriptCommand.plus(" ").plus(args) @@ -176,7 +179,8 @@ open class ComponentRemotePythonExecutor( setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, "".asJsonPrimitive()) } } catch (grpcEx: io.grpc.StatusRuntimeException) { - val grpcErrMsg = "Command failed during env. preparation... timeout($envPrepTimeout) requestId ($processId)." + val componentLevelWarningMsg = if (timeout < envPrepTimeout) "Note: component-level timeout ($timeout) is shorter than env-prepare timeout ($envPrepTimeout). " else "" + val grpcErrMsg = "Command failed during env. preparation... timeout($envPrepTimeout) requestId ($processId). $componentLevelWarningMsg" setAttribute(ATTRIBUTE_PREPARE_ENV_LOG, grpcErrMsg.asJsonPrimitive()) setNodeOutputErrors(status = grpcErrMsg, step = STEP_PREPARE_ENV, error = "${grpcEx.status}".asJsonPrimitive(), logging = isLogResponseEnabled) log.error(grpcErrMsg, grpcEx) @@ -229,7 +233,8 @@ open class ComponentRemotePythonExecutor( ) } } catch (timeoutEx: TimeoutCancellationException) { - val timeoutErrMsg = "Command executor timed out executing after $executionTimeout seconds requestId ($processId)" + val componentLevelWarningMsg = if (timeout < executionTimeout) "Note: component-level timeout ($timeout) is shorter than execution timeout ($executionTimeout). " else "" + val timeoutErrMsg = "Command executor execution timeout. DetailedMessage: (${timeoutEx.message}) requestId ($processId). $componentLevelWarningMsg" setNodeOutputErrors(status = timeoutErrMsg, step = STEP_EXEC_CMD, logs = "".asJsonPrimitive(), @@ -238,7 +243,7 @@ open class ComponentRemotePythonExecutor( ) log.error(timeoutErrMsg, timeoutEx) } catch (grpcEx: io.grpc.StatusRuntimeException) { - val timeoutErrMsg = "Command executor timed out executing after $executionTimeout seconds requestId ($processId)" + val timeoutErrMsg = "Command executor failed to execute requestId ($processId) error (${grpcEx.status.cause?.message})" setNodeOutputErrors(status = timeoutErrMsg, step = STEP_EXEC_CMD, logs = "".asJsonPrimitive(), |