summaryrefslogtreecommitdiffstats
path: root/ueb-listener
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dtimoney@att.com>2018-11-02 10:11:48 -0400
committerTimoney, Dan (dt5972) <dtimoney@att.com>2018-11-02 10:11:48 -0400
commit6c7fe51e60d5736234254da47be4a4c4cb74513c (patch)
tree7e52230e93d725032f0d832aaede4904374f2e3a /ueb-listener
parentdfa695ebe1cfac0e7f28b4bd6fe895070ce8c794 (diff)
Explicitly exit on timeout
Previously, when timeout occurs trying to connect successfully to SDC, code just dropped out of loop in main() method, expecting to exit. However, if the SDC client left any threads hanging, that might not cause process to exit. Instead, process should explicitly exit via System.exit(). Change-Id: I28316550cbfc2bbddeaadf080c0afa52a1eae350 Issue-ID: SDNC-472 Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
Diffstat (limited to 'ueb-listener')
-rw-r--r--ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java
index 4f2de1cc..2078a798 100644
--- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java
+++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebClient.java
@@ -54,6 +54,7 @@ public class SdncUebClient {
long maxWaitTm = config.getClientStartupTimeout() * 1000L;
boolean keepWaiting = true;
+ boolean listenerStarted = false;
while (keepWaiting) {
if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) {
@@ -66,8 +67,9 @@ public class SdncUebClient {
if (start.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) {
keepWaiting = false;
+ listenerStarted = true;
} else {
- LOG.info("SDC returned "+start.getDistributionActionResult().toString()+" - will retry");
+ LOG.info("SDC returned {} - exitting",start.getDistributionActionResult().toString());
try {
client.stop();
} catch(Exception e1) {
@@ -99,8 +101,13 @@ public class SdncUebClient {
}
}
-
-
+
+ if (!listenerStarted) {
+ LOG.info("Timed out waiting to connect to SDC");
+ System.exit(0);
+ }
+
+
}