diff options
-rw-r--r-- | common-logging/pom.xml | 2 | ||||
-rw-r--r-- | integrity-audit/pom.xml | 2 | ||||
-rw-r--r-- | integrity-monitor/pom.xml | 2 | ||||
-rw-r--r-- | integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java | 71 | ||||
-rw-r--r-- | integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java | 56 | ||||
-rw-r--r-- | pom.xml | 27 | ||||
-rw-r--r-- | site-manager/pom.xml | 2 | ||||
-rw-r--r-- | version.properties | 4 |
8 files changed, 108 insertions, 58 deletions
diff --git a/common-logging/pom.xml b/common-logging/pom.xml index d16cdbfe..400434c1 100644 --- a/common-logging/pom.xml +++ b/common-logging/pom.xml @@ -25,7 +25,7 @@ <parent> <groupId>org.onap.policy.common</groupId> <artifactId>common-modules</artifactId> - <version>1.1.1-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> </parent> <artifactId>ONAP-Logging</artifactId> diff --git a/integrity-audit/pom.xml b/integrity-audit/pom.xml index 90d182b8..7f20620f 100644 --- a/integrity-audit/pom.xml +++ b/integrity-audit/pom.xml @@ -30,7 +30,7 @@ <parent> <groupId>org.onap.policy.common</groupId> <artifactId>common-modules</artifactId> - <version>1.1.1-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> </parent> <name>Integrity Audit</name> diff --git a/integrity-monitor/pom.xml b/integrity-monitor/pom.xml index 576d56bc..3ee95c71 100644 --- a/integrity-monitor/pom.xml +++ b/integrity-monitor/pom.xml @@ -30,7 +30,7 @@ <parent> <groupId>org.onap.policy.common</groupId> <artifactId>common-modules</artifactId> - <version>1.1.1-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> </parent> <name>Integrity Monitor</name> diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java index ceb6d695..93cee577 100644 --- a/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java +++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/IntegrityMonitor.java @@ -815,7 +815,6 @@ public class IntegrityMonitor { } catch (Exception e) { error_msg = dep + ": resource sanity test failed with exception: "; logger.error("{}", error_msg, e); - // TODO: extract real error message from exception which may be nested } finally { // close the JMX connector if (jmxAgentConnection != null) { @@ -837,6 +836,35 @@ public class IntegrityMonitor { String error_msg = ""; boolean dependencyFailure = false; + /* + * Before we check dependency groups we need to check subsystemTest. + */ + try { + //Test any subsystems that are not covered under the dependency relationship + subsystemTest(); + }catch (Exception e){ + logger.error("IntegrityMonitor threw exception", e); + dependencyFailure=true; + //This indicates a subsystemTest failure + try { + if(logger.isDebugEnabled()){ + logger.debug("{}: There has been a subsystemTest failure with error:{} Updating this resource's state to disableDependency", resourceName, e.getMessage()); + } + //Capture the subsystemTest failure info + if(!error_msg.isEmpty()){ + error_msg = error_msg.concat(","); + } + error_msg = error_msg.concat(resourceName + ": " + e.getMessage()); + this.stateManager.disableDependency(); + } catch (Exception ex) { + logger.error("IntegrityMonitor threw exception.", ex); + if (!error_msg.isEmpty()) { + error_msg = error_msg.concat(","); + } + error_msg = error_msg.concat("\n" + resourceName + ": Failed to disable dependency after subsystemTest failure due to: " + ex.getMessage()); + } + } + // Check the sanity of dependents for lead subcomponents if (dep_groups != null && dep_groups.length > 0) { @@ -906,8 +934,10 @@ public class IntegrityMonitor { }//end for (String group : dep_groups) + /* - * We have checked all the dependency groups. If all are ok, dependencyFailure == false + * We have checked all the dependency groups. If all are ok and subsystemTest passed, + * dependencyFailure == false */ if(!dependencyFailure){ try { @@ -927,7 +957,7 @@ public class IntegrityMonitor { error_msg = error_msg.concat(resourceName + ": Failed to enable no dependency"); } } - }else{ + }else if(!dependencyFailure){ /* * This is put here to clean up when no dependency group should exist, but one was erroneously * added which caused the state to be disabled/dependency/coldstandby and later removed. We saw @@ -951,35 +981,7 @@ public class IntegrityMonitor { } } - /* - * We have checked dependency groups and if there were none, we set enableNoDependency. If there were some - * but they are all ok, we set enableNoDependency. So, the recovery from a disabled dependency state - * is handled above. We only need to set disableDependency if the subsystemTest fails. - */ - try { - //Test any subsystems that are not covered under the dependency relationship - subsystemTest(); - }catch (Exception e){ - logger.error("IntegrityMonitor threw exception", e); - //This indicates a subsystemTest failure - try { - if(logger.isDebugEnabled()){ - logger.debug("{}: There has been a subsystemTest failure with error:{} Updating this resource's state to disableDependency", resourceName, e.getMessage()); - } - //Capture the subsystemTest failure info - if(!error_msg.isEmpty()){ - error_msg = error_msg.concat(","); - } - error_msg = error_msg.concat(resourceName + ": " + e.getMessage()); - this.stateManager.disableDependency(); - } catch (Exception ex) { - logger.error("IntegrityMonitor threw exception.", ex); - if (!error_msg.isEmpty()) { - error_msg = error_msg.concat(","); - } - error_msg = error_msg.concat("\n" + resourceName + ": Failed to disable dependency after subsystemTest failure due to: " + ex.getMessage()); - } - } + if (!error_msg.isEmpty()) { logger.error("Sanity failure detected in a dependent resource: {}", error_msg); @@ -1311,8 +1313,6 @@ public class IntegrityMonitor { elapsedTime = 0; // reset elapsed time - // TODO: check if alarm exists - try { if (fpCounter == lastFpCounter) { // no forward progress @@ -1325,7 +1325,6 @@ public class IntegrityMonitor { // Note: The refreshStateAudit will make redundant calls stateManager.disableFailed(); }// The refreshStateAudit will catch the case where opStat = disabled and availState ! failed/dependency.failed - // TODO: raise alarm or Nagios alert alarmExists = true; } } else { @@ -1340,8 +1339,6 @@ public class IntegrityMonitor { // Note: The refreshStateAudit will make redundant calls stateManager.enableNotFailed(); }// The refreshStateAudit will catch the case where opState=enabled and availStatus != null - - // TODO: clear alarm or Nagios alert alarmExists = false; } } catch (Exception e) { diff --git a/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java b/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java index cf78b775..637a3042 100644 --- a/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java +++ b/integrity-monitor/src/main/java/org/onap/policy/common/im/StateManagement.java @@ -129,11 +129,15 @@ public class StateManagement extends Observable { } em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } } else { synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } } @@ -188,7 +192,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(ADMIN_STATE); @@ -243,7 +249,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(ADMIN_STATE); @@ -297,7 +305,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(ADMIN_STATE); @@ -352,7 +362,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(OPERATION_STATE); @@ -405,7 +417,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(OPERATION_STATE); @@ -464,7 +478,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(OPERATION_STATE); @@ -519,7 +535,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(OPERATION_STATE); @@ -574,7 +592,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(OPERATION_STATE); @@ -691,7 +711,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } setChanged(); notifyObservers(STANDBY_STATUS); @@ -752,7 +774,9 @@ public class StateManagement extends Observable { em.persist(sm); synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } //We don't notify observers because this is assumed to be a remote resource @@ -984,7 +1008,9 @@ public String getOpState() logger.error("getStandbyStatus: resourceName ={} not found in statemanagemententity table", otherResourceName); } synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } } catch (Exception e) { logger.error("getStandbyStatus: Caught Exception attempting to get statemanagemententity record, message='{}'", e.getMessage(), e); @@ -1036,7 +1062,9 @@ public String getOpState() em.remove(stateManagementEntity); } synchronized(FLUSHLOCK){ - et.commit(); + if(et.isActive()){ + et.commit(); + } } }catch(Exception ex){ logger.error("StateManagement.deleteAllStateManagementEntities() caught Exception: ", ex); @@ -31,7 +31,7 @@ <groupId>org.onap.policy.common</groupId> <artifactId>common-modules</artifactId> - <version>1.1.1-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> <packaging>pom</packaging> @@ -64,6 +64,31 @@ </site> </distributionManagement> + <repositories> + <!-- LF repositories --> + <repository> + <id>ecomp-releases</id> + <name>Release Repository</name> + <url>${nexusproxy}/content/repositories/releases/</url> + </repository> + <repository> + <id>ecomp-staging</id> + <name>Staging Repository</name> + <url>${nexusproxy}/content/repositories/staging/</url> + </repository> + <repository> + <id>ecomp-snapshots</id> + <name>Snapshots Repository</name> + <url>${nexusproxy}/content/repositories/snapshots/</url> + </repository> + <repository> + <id>ecomp-public</id> + <name>Public Repository</name> + <url>${nexusproxy}/content/repositories/public/</url> + </repository> + <!-- LF repositories END--> + </repositories> + <build> <plugins> <plugin> diff --git a/site-manager/pom.xml b/site-manager/pom.xml index e2209c39..8726825e 100644 --- a/site-manager/pom.xml +++ b/site-manager/pom.xml @@ -31,7 +31,7 @@ <parent> <groupId>org.onap.policy.common</groupId> <artifactId>common-modules</artifactId> - <version>1.1.1-SNAPSHOT</version> + <version>1.2.0-SNAPSHOT</version> </parent> <name>site-manager</name> diff --git a/version.properties b/version.properties index 55fbf441..faf06bbb 100644 --- a/version.properties +++ b/version.properties @@ -3,8 +3,8 @@ # because they are used in Jenkins, whose plug-in doesn't support major=1 -minor=1 -patch=1 +minor=2 +patch=0 base_version=${major}.${minor}.${patch} |