From 0562fc1c7378be67b571bb142489272a6b1b3814 Mon Sep 17 00:00:00 2001 From: Sebastien Premont-Tendland Date: Mon, 2 Mar 2020 14:33:33 -0500 Subject: Fix kotlin cache lazy loading When USE_SCRIPT_COMPILATION_CACHE is set to false the classLoader is closed after the class is instantiated. This is causing an issue when lazy loading is happening during the script execution. Lazy loading occurs when a suspendible function returning something is called from "processNB", kotlin will create a second class that will be loaded during execution (needs to be in the classpath during execution). Issue-ID: CCSDK-2150 Signed-off-by: Sebastien Premont-Tendland Change-Id: I64780287352d762325662e0e5d5b94038dedee7f --- .../functions/netconf/executor/ComponentNetconfExecutor.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ms/blueprintsprocessor/functions/netconf-executor/src') diff --git a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt index 1262e8500..307e73e6b 100644 --- a/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt +++ b/ms/blueprintsprocessor/functions/netconf-executor/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/netconf/executor/ComponentNetconfExecutor.kt @@ -65,6 +65,9 @@ open class ComponentNetconfExecutor(private var componentFunctionScriptingServic // Handles both script processing and error handling scriptComponent.executeScript(executionServiceInput) + + componentFunctionScriptingService.cleanupInstance(bluePrintRuntimeService.bluePrintContext(), + scriptType) } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { -- cgit 1.2.3-korg