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>
long maxWaitTm = config.getClientStartupTimeout() * 1000L;
boolean keepWaiting = true;
+ boolean listenerStarted = false;
while (keepWaiting) {
if (result.getDistributionActionResult() == DistributionActionResultEnum.SUCCESS) {
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) {
}
}
-
-
+
+ if (!listenerStarted) {
+ LOG.info("Timed out waiting to connect to SDC");
+ System.exit(0);
+ }
+
+
}