summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java12
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java2
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java2
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java1
4 files changed, 9 insertions, 8 deletions
diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java
index e6603b68..b48690b0 100644
--- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java
+++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/PersistenceFeature.java
@@ -732,7 +732,7 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
* before firing rules again. This is a "half" time, so that
* we can multiply it by two without overflowing the word size.
*/
- long halfMaxSleepTime = 5000 / 2;
+ long halfMaxSleepTime = 5000L / 2L;
/**
* Constructor - initialize variables and create thread
@@ -819,6 +819,7 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
} catch (InterruptedException e) {
logger.error("stopThread exception: ", e);
+ Thread.currentThread().interrupt();
}
// verify that it's done
@@ -866,11 +867,9 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
// no rules fired -- increase poll delay
sleepTime = 2 * Math.min(halfMaxSleepTime, sleepTime);
}
-
- } catch (Throwable e) {
- logger.error("startThread exception: ", e);
- }
-
+ } catch (Exception | LinkageError e) {
+ logger.error("Exception during kieSession.fireAllRules", e);
+ }
try {
if(stopped.await(sleepTime, TimeUnit.MILLISECONDS)) {
@@ -879,6 +878,7 @@ public class PersistenceFeature implements PolicySessionFeatureAPI, PolicyEngine
} catch (InterruptedException e) {
logger.error("startThread exception: ", e);
+ Thread.currentThread().interrupt();
break;
}
}
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java
index c4155b77..8171c35d 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/event/comm/bus/internal/BusConsumer.java
@@ -310,7 +310,7 @@ public interface BusConsumer {
consumerInstance, fetchTimeout, fetchLimit, useHttps);
// super constructor sets servers = {""} if empty to avoid errors when using DME2
- if ((servers.size() == 1 && servers.get(0).equals("")) || (servers == null)
+ if ((servers.size() == 1 && ("".equals(servers.get(0)))) || (servers == null)
|| (servers.isEmpty())) {
throw new IllegalArgumentException("Must provide at least one host for HTTP AAF");
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java b/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
index 5ac17253..e217ee7d 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
@@ -164,7 +164,7 @@ public class FileSystemPersistence implements SystemPersistence {
this.backupController(controllerName);
}
} catch (final Exception e) {
- logger.info("{}: no existing {} properties", this, controllerName);
+ logger.info("{}: no existing {} properties {}", this, controllerName, e);
// continue
}
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
index a6f79374..b2b2df6d 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
@@ -998,6 +998,7 @@ class PolicyEngineManager implements PolicyEngine {
Thread.sleep(5000L);
} catch (final InterruptedException e) {
logger.warn("{}: interrupted-exception while shutting down management server: ", this);
+ Thread.currentThread().interrupt();
}
System.exit(0);