From 83c173ad85ead93ba98cfcd1d1ef7fe2142edaa6 Mon Sep 17 00:00:00 2001 From: Oleg Mitsura Date: Tue, 7 Jun 2022 10:05:20 -0400 Subject: CCSDK-3684 ComponentRemotePYthonExecutor eliminate recursive call Issue-ID: CCSDK-3684 prepareEnv (mistakenly) had a recursive call, but no decement. Simplified it in favour of the inner/outter flag instead of retry counter as in Frankfurt release. Signed-off-by: Oleg Mitsura Change-Id: I5d7f623d6e206a844d33d95a15f85758da3a6681 --- .../functions/python/executor/ComponentRemotePythonExecutor.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ms') 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 eaefde7ce..f0ea8c3fb 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 @@ -274,7 +274,7 @@ open class ComponentRemotePythonExecutor( } // wrapper for call to prepare_env step on cmd-exec - reupload CBA and call prepare env again if cmd-exec reported CBA uuid mismatch - private suspend fun prepareEnv(originatorId: String, requestId: String, subRequestId: String, remoteIdentifier: RemoteIdentifier, packages: JsonNode, envPrepTimeout: Int, cbaNameVerUuid: String, archiveType: String?, cbaBinData: ByteString?, isLogResponseEnabled: Boolean, retries: Int = 3) { + private suspend fun prepareEnv(originatorId: String, requestId: String, subRequestId: String, remoteIdentifier: RemoteIdentifier, packages: JsonNode, envPrepTimeout: Int, cbaNameVerUuid: String, archiveType: String?, cbaBinData: ByteString?, isLogResponseEnabled: Boolean, innerCall: Boolean = false) { val prepareEnvInput = PrepareRemoteEnvInput( originatorId = originatorId, requestId = requestId, @@ -298,7 +298,7 @@ open class ComponentRemotePythonExecutor( log.info("Cmd-exec is missing the CBA $cbaNameVerUuid, it will be reuploaded.") uploadCba(remoteIdentifier, requestId, subRequestId, originatorId, archiveType, cbaBinData, cbaNameVerUuid, prepareEnvOutput, isLogResponseEnabled, logs) // call prepare_env again. - if (retries > 0) { + if (!innerCall) { log.info("Calling prepare environment again") prepareEnv(originatorId, requestId, subRequestId, remoteIdentifier, packages, envPrepTimeout, cbaNameVerUuid, archiveType, cbaBinData, isLogResponseEnabled) } else { -- cgit 1.2.3-korg