Github user kevinxu021 commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1427#discussion_r172735971
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java ---
@@ -262,12 +308,38 @@ public void run() {
future.get();// block
} catch (Exception e) {
- LOG.error(e);
- e.printStackTrace();
+ LOG.error(e.getMessage(), e);
+ try {
+ FloatingIp floatingIp = FloatingIp.getInstance(this);
+ floatingIp.unbindScript();
+ } catch (Exception e1) {
+ if (LOG.isErrorEnabled()) {
+ LOG.error("Error creating class FloatingIp [" +
e.getMessage() + "]", e1);
+ }
+ }
if (pool != null)
pool.shutdown();
- System.exit(0);
+ if (ls != null) {
+ ListenerWorker lw = ls.getWorker();
+ if (lw != null) {
+ lw.interrupt();
+ LOG.info("Interrupt listenerWorker.");
+ }
+ ls.interrupt();
+ LOG.info("Interrupt listenerService.");
+ }
+ if (infoServer != null) {
+ try {
+ infoServer.stop();
+ LOG.info("Stop infoServer.");
+ } catch (Exception e1) {
+ LOG.error(e1.getMessage(), e1);
+ }
+ }
+ return 1;
+
--- End diff --
Add try-catch for each progress.
---