Improve error when Cluster MBean is gone #2033
When the Cluster JMX MBean is missing jmxsh-R5.jar produces 'Cannot convert result to a string' as an error message. Recognize this error and give a more meaningful one back to the user.
This commit is contained in:
parent
b3444fa1b0
commit
54ccb293c8
1 changed files with 6 additions and 3 deletions
9
akka-kernel/src/main/dist/bin/akka-cluster
vendored
9
akka-kernel/src/main/dist/bin/akka-cluster
vendored
|
|
@ -33,9 +33,13 @@ function get() {
|
|||
}
|
||||
|
||||
function ensureNodeIsRunningAndAvailable {
|
||||
REPLY=$(get Available) # redirects STDERR to STDOUT before capturing it
|
||||
REPLY=$(get Available 2>&1) # redirects STDERR to STDOUT before capturing it
|
||||
if [[ "$REPLY" != *true ]]; then
|
||||
echo "Akka cluster node is not available on $HOST, due to $REPLY"
|
||||
if [[ "$REPLY" == *"Cannot convert result to a string." ]]; then
|
||||
echo "Akka cluster MBean is not available on $HOST:$PORT"
|
||||
else
|
||||
echo "Akka cluster node is not available on $HOST:$PORT, due to $REPLY"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -61,7 +65,6 @@ case "$1" in
|
|||
fi
|
||||
|
||||
ensureNodeIsRunningAndAvailable
|
||||
|
||||
ACTOR_SYSTEM_URL=$2
|
||||
echo "Scheduling $ACTOR_SYSTEM_URL to LEAVE cluster"
|
||||
invoke leave $ACTOR_SYSTEM_URL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue