diff options
author | Julien Fontaine <julien.fontaine@bell.ca> | 2020-12-02 16:25:08 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2020-12-16 14:59:41 +0000 |
commit | 55e4780ba5f1de52060eaf76608a588b5be7c788 (patch) | |
tree | 04d3f19854d69df27f916b9052fab916032644ad /ms/blueprintsprocessor/modules/services/execution-service | |
parent | 6b33380a6f3cbc0185058d189de6436651a288e5 (diff) |
Fixed NoClassDefFoundError when USE_SCRIPT_COMPILE_CACHE is set to false
USE_SCRIPT_COMPILE_CACHE set to false cleans the Class Loader cache after each kotlin script execution.
When several kotlin script are executed in parallel (ie no dependency between them) and USE_SCRIPT_COMPILE_CACHE=false then
the class loader from the cache may be deleted before one of those executed kotlin script get the time to finish which to the NoClassDefFoundError.
Removed cleanupInstance method for kotlin script executors that where causing the class loader to be removed prematurely.
Now the behaviour is to remove the class loader from the cache only when we publish a new CBA which was already the case when CDS run with a single instance.
In cluster mode, a topic has been added to hazelcast to allow the instance publishing the updated CBA to communicate to the other instances by sending a message to clean the class loader
for this CBA from their cache.
Added mutex on kotlin script compilation to fix race condition. For concurrent kotlin script execution each process wanted to compile an executable but it was causing a race condition if a process tries to execute while another still compile. Mutex on the execution path prevent this behaviour
Issue-ID: CCSDK-3052
Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca>
Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
Change-Id: I6ab002352b3272898ad0b183341ee664652c8ae3
Diffstat (limited to 'ms/blueprintsprocessor/modules/services/execution-service')
2 files changed, 0 insertions, 8 deletions
diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt index d107f01e5..3483ce1d7 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentFunctionScriptingService.kt @@ -101,10 +101,4 @@ class ComponentFunctionScriptingService( } return scriptComponent } - - suspend fun cleanupInstance(bluePrintContext: BluePrintContext, scriptType: String) { - if (scriptType == BluePrintConstants.SCRIPT_KOTLIN) { - BluePrintScriptsServiceImpl().cleanupInstance(bluePrintContext.rootPath) - } - } } diff --git a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt index 34eaf6226..a7ef0a8a0 100644 --- a/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt +++ b/ms/blueprintsprocessor/modules/services/execution-service/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/services/execution/ComponentScriptExecutor.kt @@ -61,8 +61,6 @@ open class ComponentScriptExecutor(private var componentFunctionScriptingService // Handles both script processing and error handling scriptComponentFunction.executeScript(executionServiceInput) - - componentFunctionScriptingService.cleanupInstance(bluePrintRuntimeService.bluePrintContext(), scriptType) } override suspend fun recoverNB(runtimeException: RuntimeException, executionRequest: ExecutionServiceInput) { |