From 0ddf7a0d1ef4bef454862a75f96832c81c5da8e3 Mon Sep 17 00:00:00 2001 From: mpriyank Date: Mon, 16 Jan 2023 14:14:41 +0000 Subject: Bug Analysis for LOCKED cmHandles - Increased TTL time from 60secs to 200secs - Added few info level logs to analyze more Issue-ID: CPS-1446 Change-Id: If4456040e51bd33a5bf321f48440e44af7698154 Signed-off-by: mpriyank --- .../api/impl/config/embeddedcache/SynchronizationCacheConfig.java | 4 ++-- .../java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasks.java | 5 +++-- .../org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java | 7 +++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java index 5154be7990..c9eb345b24 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/config/embeddedcache/SynchronizationCacheConfig.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================== - * Copyright (C) 2022 Nordix Foundation + * Copyright (C) 2022-2023 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ import org.springframework.context.annotation.Configuration; @Configuration public class SynchronizationCacheConfig { - public static final int MODULE_SYNC_STARTED_TTL_SECS = 60; + public static final int MODULE_SYNC_STARTED_TTL_SECS = 200; public static final int DATA_SYNC_SEMAPHORE_TTL_SECS = 1800; private static final QueueConfig commonQueueConfig = createQueueConfig(); diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasks.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasks.java index 004ef289ac..3fbebe0771 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasks.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasks.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation + * Copyright (C) 2022-2023 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,6 +97,7 @@ public class ModuleSyncTasks { for (final YangModelCmHandle failedCmHandle : failedCmHandles) { final CompositeState compositeState = failedCmHandle.getCompositeState(); final boolean isReadyForRetry = syncUtils.isReadyForRetry(compositeState); + log.info("Retry for cmHandleId : {} is {}", failedCmHandle.getId(), isReadyForRetry); if (isReadyForRetry) { final String resetCmHandleId = failedCmHandle.getId(); log.debug("Reset cm handle {} state to ADVISED to be re-attempted by module-sync watchdog", @@ -115,7 +116,7 @@ public class ModuleSyncTasks { private void removeResetCmHandleFromModuleSyncMap(final String resetCmHandleId) { if (moduleSyncStartedOnCmHandles.remove(resetCmHandleId) != null) { - log.debug("{} removed from in progress map", resetCmHandleId); + log.info("{} removed from in progress map", resetCmHandleId); } } } diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java index f629b71d26..e5398374d9 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncWatchdog.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation + * Copyright (C) 2022-2023 Nordix Foundation * Modifications Copyright (C) 2022 Bell Canada * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -88,11 +88,13 @@ public class ModuleSyncWatchdog { public void resetPreviouslyFailedCmHandles() { log.info("Processing module sync retry-watchdog waking up."); final List failedCmHandles = syncUtils.getModuleSyncFailedCmHandles(); + log.info("Retrying {} cmHandles", failedCmHandles.size()); moduleSyncTasks.resetFailedCmHandles(failedCmHandles); } private void preventBusyWait() { try { + log.info("Busy waiting now"); TimeUnit.MILLISECONDS.sleep(PREVENT_CPU_BURN_WAIT_TIME_MILLIS); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); @@ -108,6 +110,7 @@ public class ModuleSyncWatchdog { log.warn("Unable to add cm handle {} to the work queue", advisedCmHandle.getLeaves().get("id")); } } + log.info("Work Queue Size : {}", moduleSyncWorkQueue.size()); } } @@ -122,7 +125,7 @@ public class ModuleSyncWatchdog { moduleSyncStartedOnCmHandles.putIfAbsent(cmHandleId, VALUE_FOR_HAZELCAST_IN_PROGRESS_MAP, SynchronizationCacheConfig.MODULE_SYNC_STARTED_TTL_SECS, TimeUnit.SECONDS)); if (alreadyAddedToInProgressMap) { - log.debug("module sync for {} already in progress by other instance", cmHandleId); + log.info("module sync for {} already in progress by other instance", cmHandleId); } else { nextBatch.add(batchCandidate); } -- cgit 1.2.3-korg