Repository: trafodion Updated Branches: refs/heads/master 877339a11 -> 8001c1549
[TRAFODION-2668] fix nid been accidentally deleted Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/2713db93 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/2713db93 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/2713db93 Branch: refs/heads/master Commit: 2713db93dadaa943b9a3d1d79bbc10b1954cf223 Parents: 98b3ac3 Author: aven <[email protected]> Authored: Wed Jun 13 16:54:59 2018 +0800 Committer: aven <[email protected]> Committed: Wed Jun 13 16:54:59 2018 +0800 ---------------------------------------------------------------------- .../java/org/trafodion/dcs/server/ServerManager.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/2713db93/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java ---------------------------------------------------------------------- diff --git a/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java b/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java index aa7e0ad..e5947c8 100644 --- a/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java +++ b/dcs/src/main/java/org/trafodion/dcs/server/ServerManager.java @@ -83,7 +83,7 @@ public final class ServerManager implements Callable { private ServerHandler[] serverHandlers; private int maxRestartAttempts; private int retryIntervalMillis; - private String nid = null; +// private String nid = null; private static String userProgKeepaliveStatus; private static int userProgKeepaliveIdletime; private static int userProgKeepaliveIntervaltime; @@ -423,12 +423,9 @@ public final class ServerManager implements Callable { featureCheck(); registerInRunning(instance); RetryCounter retryCounter = RetryCounterFactory.create(maxRestartAttempts, retryIntervalMillis); - while (!isTrafodionRunning(nid)) { + while (!isTrafodionRunning(null)) { if (!retryCounter.shouldRetry()) { - if (nid != null) - throw new IOException("Node " + nid + " is not Up"); - else - throw new IOException("Trafodion is not running"); + throw new IOException("Trafodion is not running"); } else { retryCounter.sleepUntilNextRetry(); retryCounter.useRetry(); @@ -464,6 +461,9 @@ public final class ServerManager implements Callable { LOG.info("Server handler [" + instance + ":" + result + "] exit"); retryCounter = RetryCounterFactory.create(maxRestartAttempts, retryIntervalMillis); + int childInstance = result.intValue(); + ServerHandler previousServerHandler = serverHandlers[childInstance - 1]; + String nid = serverHandlers[childInstance - 1].serverMonitor.nid; while (!isTrafodionRunning(nid)) { if (!retryCounter.shouldRetry()) { throw new IOException("Node " + nid + " is not Up"); @@ -472,9 +472,7 @@ public final class ServerManager implements Callable { retryCounter.useRetry(); } } - int childInstance = result.intValue(); // get the node id - ServerHandler previousServerHandler = serverHandlers[childInstance - 1]; if (previousServerHandler.retryCounter.shouldRetryInnerMinutes()) { serverHandlers[childInstance - 1] = previousServerHandler; completionService.submit(serverHandlers[childInstance - 1]);
