Github user kevinxu021 commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1427#discussion_r172733924
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java ---
@@ -129,19 +170,19 @@ public void run() {
instance = "1";
} catch (NullPointerException e) {
LOG.error("No args found: ", e);
- System.exit(1);
+ return -1;
} catch (ParseException e) {
LOG.error("Could not parse: ", e);
- System.exit(1);
+ return -1;
}
try {
zkc = new ZkClient();
zkc.connect();
LOG.info("Connected to ZooKeeper");
} catch (Exception e) {
- LOG.error(e);
- System.exit(1);
+ LOG.error(e.getMessage(), e);
+ return 1;
--- End diff --
Close zk connection while any connection exception happens. it's better to
use specific Exception for zookeeper.
---