summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons/db-lib
diff options
context:
space:
mode:
authorJulien Fontaine <julien.fontaine@bell.ca>2021-01-20 18:28:49 -0500
committerJulien Fontaine <julien.fontaine@bell.ca>2021-04-28 17:20:37 -0400
commit7727db93b8c157e3b6e563c1f8093f8eddd9ad5a (patch)
treee618dc8bf4c4457b904992727dc48a70dbd175d4 /ms/blueprintsprocessor/modules/commons/db-lib
parentbfca233b96801b53af015f3532fa73c615fef6e4 (diff)
Fixed error when uploading CBA when Hazelcast cluster is not initialized
Hazelcast is used to enable CDS pods to notify the rest of the CDS cluster when a CBA got updated locally so they clean their compile cache (if they have an entry for that CBA). Though, the code doesn't make sure that hazelcast cluster is fully initialized before trying to notify using a hazelcast topic. Fixed that error by making sure that the cluster is fully initialized before pushing notification to hazelcast topic. Issue-ID: CCSDK-3277 Change-Id: I44211c63c5a991269005bcc238f18b19979cb718 Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca>
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons/db-lib')
-rwxr-xr-xms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt6
1 files changed, 2 insertions, 4 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt
index 10a526365..5b9853855 100755
--- a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/db/primary/service/BlueprintProcessorCatalogServiceImpl.kt
@@ -180,11 +180,9 @@ class BlueprintProcessorCatalogServiceImpl(
private suspend fun cleanClassLoader(cacheKey: String) {
val clusterService = BlueprintDependencyService.optionalClusterService()
- if (null == clusterService)
- BlueprintCompileCache.cleanClassLoader(cacheKey)
- else {
+ if (clusterService != null && clusterService.clusterJoined()) {
log.info("Sending ClusterMessage: Clean Classloader Cache")
clusterService.sendMessage(BlueprintClusterTopic.BLUEPRINT_CLEAN_COMPILER_CACHE, cacheKey)
- }
+ } else BlueprintCompileCache.cleanClassLoader(cacheKey)
}
}