geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kh...@apache.org
Subject geode git commit: check for string "nul" in server/locator status message
Date Fri, 10 Mar 2017 23:10:40 GMT
Repository: geode
Updated Branches:
  refs/heads/feature/GEODE-2599 [created] 191743f00


check for string "nul" in server/locator status message


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/191743f0
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/191743f0
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/191743f0

Branch: refs/heads/feature/GEODE-2599
Commit: 191743f00122deec1304504fc6ddce33b1dbb2c5
Parents: 0f48fa3
Author: Ken Howe <khowe@pivotal.io>
Authored: Fri Mar 10 15:09:04 2017 -0800
Committer: Ken Howe <khowe@pivotal.io>
Committed: Fri Mar 10 15:09:04 2017 -0800

----------------------------------------------------------------------
 .../cli/commands/LauncherLifecycleCommands.java | 40 +++++---------------
 1 file changed, 9 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/191743f0/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
index d42d75e..c7ab87f 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LauncherLifecycleCommands.java
@@ -384,21 +384,9 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
                 new File(locatorLauncher.getWorkingDirectory()))),
             null);
 
+        locatorState = locatorStatus(workingDirectory, memberName);
         do {
-          try {
-            final int exitValue = locatorProcess.exitValue();
-
-            stderrReader.join(PROCESS_STREAM_READER_JOIN_TIMEOUT_MILLIS); // was Long.MAX_VALUE
-
-            // Gfsh.println(message);
-
-            return ResultBuilder.createShellClientErrorResult(
-                String.format(CliStrings.START_LOCATOR__PROCESS_TERMINATED_ABNORMALLY_ERROR_MESSAGE,
-                    exitValue, locatorLauncher.getWorkingDirectory(), message.toString()));
-          } catch (IllegalThreadStateException ignore) {
-            // the IllegalThreadStateException is expected; it means the Locator's process
has not
-            // terminated,
-            // and basically should not
+          if (locatorProcess.isAlive()) {
             Gfsh.print(".");
 
             synchronized (this) {
@@ -410,8 +398,9 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
             String currentLocatorStatusMessage = locatorState.getStatusMessage();
 
             if (isStartingOrNotResponding(locatorState.getStatus())
-                && !(StringUtils.isBlank(currentLocatorStatusMessage) || currentLocatorStatusMessage
-                    .equalsIgnoreCase(previousLocatorStatusMessage))) {
+                && !(StringUtils.isBlank(currentLocatorStatusMessage)
+                    || currentLocatorStatusMessage.equalsIgnoreCase(previousLocatorStatusMessage)
+                    || currentLocatorStatusMessage.trim().toLowerCase().equals("null")))
{
               Gfsh.println();
               Gfsh.println(currentLocatorStatusMessage);
               previousLocatorStatusMessage = currentLocatorStatusMessage;
@@ -1646,21 +1635,9 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
                 new File(serverLauncher.getWorkingDirectory()))),
             null);
 
+        serverState = serverStatus(workingDirectory, memberName);
         do {
-          try {
-            final int exitValue = serverProcess.exitValue();
-
-            stderrReader.join(PROCESS_STREAM_READER_JOIN_TIMEOUT_MILLIS); // was Long.MAX_VALUE
-
-            // Gfsh.println(message);
-
-            return ResultBuilder.createShellClientErrorResult(
-                String.format(CliStrings.START_SERVER__PROCESS_TERMINATED_ABNORMALLY_ERROR_MESSAGE,
-                    exitValue, serverLauncher.getWorkingDirectory(), message.toString()));
-          } catch (IllegalThreadStateException ignore) {
-            // the IllegalThreadStateException is expected; it means the Server's process
has not
-            // terminated,
-            // and should not
+          if (serverProcess.isAlive()) {
             Gfsh.print(".");
 
             synchronized (this) {
@@ -1673,7 +1650,8 @@ public class LauncherLifecycleCommands extends AbstractCommandsSupport
{
 
             if (isStartingOrNotResponding(serverState.getStatus())
                 && !(StringUtils.isBlank(currentServerStatusMessage)
-                    || currentServerStatusMessage.equalsIgnoreCase(previousServerStatusMessage)))
{
+                || currentServerStatusMessage.equalsIgnoreCase(previousServerStatusMessage)
+                || currentServerStatusMessage.trim().toLowerCase().equals("null"))) {
               Gfsh.println();
               Gfsh.println(currentServerStatusMessage);
               previousServerStatusMessage = currentServerStatusMessage;


Mime
View raw message