[ https://issues.apache.org/jira/browse/GEODE-2971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16031489#comment-16031489 ]
ASF GitHub Bot commented on GEODE-2971: --------------------------------------- GitHub user PurelyApplied opened a pull request: https://github.com/apache/geode/pull/551 GEODE-2971: consistency in shell exit codes for status commands. * Replaced all System.exit parameters with ShellExitCode references for extensibility * Added FakeLaunchers to Locator- and ServerStarterRules to spoof member status and to register the instance to the Launcher class. The spoofed status is of mixed reliability and only used when connected via jmx (via `--name`, not `--dir` or `--pid`). * Expanded starter rules to spawn PID files in working directory. * Made `getMemberMXBean` static, added public `isMemberMXBeanAvailable` to allow tests to delay tests until server is ready. * Code cleanup of touched files. Precheckin ran nearly-fully-green. One test failure which I suspect to be unrelated to these changes. This test passed cleanly when run with `gradlew -distributedTest.single=...`. Currently rerunning DUnits together to verify. You can merge this pull request into a Git repository by running: $ git pull https://github.com/PurelyApplied/geode gem-1370 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/geode/pull/551.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #551 ---- commit 91ee3d79102fafa9521a219aa8d3527bea519922 Author: Patrick Rhomberg <prhomb...@pivotal.io> Date: 2017-05-30T21:25:47Z GEODE-2971: consistency in shell exit codes for status commands. * Replaced all System.exit calls with ShellExitCode references for extensibility * Added FakeLaunchers to Locator- and ServerStarterRules to spoof member status made via jmx (not --pid or --dir options) * Expanded starter rules to spawn PID files * Made getMemberMXBean static, made public isMemberMXBeanAvailable to delay tests until server is ready. * Code cleanup of touched files. ---- > Inconsistency in gfsh status command > ------------------------------------ > > Key: GEODE-2971 > URL: https://issues.apache.org/jira/browse/GEODE-2971 > Project: Geode > Issue Type: Bug > Components: gfsh > Reporter: Patrick Rhomberg > > There is a general inconsistency in gfsh's exit status to the shell. This > makes scripting rather difficult. For instance: > * Locator & Server Online (+) > ** --pid: exit code {{0}} for both, all good. > ** --name: exit code {{0}} for both, all good. > ** --dir: exit code {{0}} for both, all good. > * Locator Online, Server Offline (-) > ** --pid: exit code is {{0}} for both. Nevertheless, the return string when > executing the command for the server returns a {{null}} within the message > (where the ip and port should be). As an example: {{Server in > /path/to/server/directory on null is currently not responding}}. > ** --name: exit code is {{0}} for the locator, {{1}} for the server because > there's no online member with the specified name... which raises the > question: there wasn't any exceptions during the execution, shouldn't we > return {{0}}?. > ** --dir: exit code is {{0}} for both. Nevertheless, the return string when > executing the command for the server returns a {{null}} within the message > (where the ip and port should be). As an example: {{Server in > /path/to/server/directory on null is currently not responding}}. > * Locator & Server Offline (-) > ** --pid: exit code for locator is {{1}}, and the return string only contains > {{null}}. The exit code for server is {{0}}, but the return string contains a > {{null}} within the message (where the ip and port should be). As an example: > {{Server in /path/to/server/directory on null is currently not responding}}. > ** --name: both return {{1}}, which is expected since there's no jmx manager > running and this option requires gfsh to be connected. > ** --dir: exit code for locator is {{1}}, and the return string only contains > {{null}}. The exit code for server is {{0}}, but the return string contains a > {{null}} within the message (where the ip and port should be). As an example: > {{Server in /path/to/server/directory on null is currently not responding}}. -- This message was sent by Atlassian JIRA (v6.3.15#6346)