From bacce97c415081df60631d97a89e80eb6b3edbab Mon Sep 17 00:00:00 2001 From: Serge Simard Date: Wed, 11 Sep 2019 13:38:15 -0400 Subject: Ensure proper unloading of resources associated with the dynamic classloader for Kotlin scripts. Issue-ID: CCSDK-1692 Signed-off-by: Serge Simard Change-Id: Ic1c1bf263331bf4a43d855798d2d62ec97503ceb --- .../cds/controllerblueprints/core/scripts/BluePrintCompilerCache.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ms/controllerblueprints/modules') diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerCache.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerCache.kt index fa6b0ab97..f90e27f4d 100644 --- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerCache.kt +++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/scripts/BluePrintCompilerCache.kt @@ -39,6 +39,10 @@ object BluePrintCompileCache { fun cleanClassLoader(key: String) { if(hasClassLoader(key)){ + // Make sure to close all classloader loaded resources before we let go of it. + // This fixes a Delete failure message on filesystem that keeps locks on opened jars; + // like Windows and NFS. + classLoaderCache.get(key).close() classLoaderCache.invalidate(key) log.info("Cleaned compiled cache($key)") }else{ -- cgit 1.2.3-korg