summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-09-14 18:13:51 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-14 18:13:51 +0000
commit8dd90c302c4c2406dba22a420d30a668969d889c (patch)
tree3a3106ddced9d2f321c5625f65c205b140c95dfc
parent1f2fff6c740695cb2ae430af16684ebc13bc57d5 (diff)
parent7e82d6a2b1409c4f59993b2946645647e2fb2b17 (diff)
Merge "Eliminate hanging when updating Drools containers"
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
index cf94bfcb..9fc2c837 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicyContainer.java
@@ -457,10 +457,19 @@ public class PolicyContainer implements Startable
logger.info("updateToVersion:releaseId " + releaseId.toString());
}
- // notify all 'PolicySession' instances
+ // stop all session threads
+ for (PolicySession session : sessions.values())
+ {
+ session.stopThread();
+ }
+
+ // update the version
Results results = kieContainer.updateToVersion(releaseId);
+
+ // restart all session threads, and notify the sessions
for (PolicySession session : sessions.values())
{
+ session.startThread();
session.updated();
}