From 58361f3aa3969cc196ea81070633571bef5fe910 Mon Sep 17 00:00:00 2001 From: Kevin McKiou Date: Mon, 8 Jan 2018 16:35:43 -0600 Subject: Initialize allSeemsWell Correctly Patch 1: Correctly initialize DroolsPdpsElectionHandler.allSeemsWell upon the first call to checkWaitTimer(). Issue-ID: POLICY-519 Change-Id: I0b9ad0bfba211d705c2d9f9305694956ca3951b6 Signed-off-by: Kevin McKiou --- .../drools/activestandby/DroolsPdpsElectionHandler.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'feature-active-standby-management/src/main') diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java index e7f40772..13348c78 100644 --- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java +++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/DroolsPdpsElectionHandler.java @@ -60,7 +60,12 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker { private String pdpdNowActive; private String pdpdLastActive; - private Boolean allSeemsWell=true; + /* + * Start allSeemsWell with a value of null so that, on the first run + * of the checkWaitTimer it will set the value in IntegrityMonitor + * regardless of whether it needs to be set to true or false. + */ + private Boolean allSeemsWell=null; private StateManagementFeatureAPI stateManagementFeature; @@ -944,7 +949,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker { //give it 10 times leeway if((nowMs - waitTimerMs) > 10*pdpUpdateInterval){ - if(allSeemsWell){ + if(allSeemsWell==null || allSeemsWell){ allSeemsWell = false; if(logger.isDebugEnabled()){ logger.debug("checkWaitTimer: calling allSeemsWell with ALLNOTWELL param"); @@ -956,7 +961,7 @@ public class DroolsPdpsElectionHandler implements ThreadRunningChecker { logger.error("checkWaitTimer: nowMs - waitTimerMs = {}" + ", exceeds 10* pdpUpdateInterval = {}" + " DesignationWaiter is STALLED!", (nowMs - waitTimerMs), (10*pdpUpdateInterval)); - }else if(!allSeemsWell){ + }else if(allSeemsWell==null || !allSeemsWell){ allSeemsWell = true; stateManagementFeature.allSeemsWell(this.getClass().getName(), StateManagementFeatureAPI.ALLSEEMSWELL, -- cgit 1.2.3-korg