HDFS-15932. Improve the balancer error message when process exits abnormally. Contributed by Renukaprasad C.
diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
index 4be554a..c4c3157 100755
--- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
+++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh
@@ -2206,7 +2206,7 @@
hadoop_verify_logdir
hadoop_status_daemon "${daemon_pidfile}"
if [[ $? == 0 ]]; then
- hadoop_error "${daemonname} is running as process $(cat "${daemon_pidfile}"). Stop it first."
+ hadoop_error "${daemonname} is running as process $(cat "${daemon_pidfile}"). Stop it first and ensure ${daemon_pidfile} file is empty before retry."
exit 1
else
# stale pid file, so just remove it and continue on
@@ -2267,7 +2267,7 @@
hadoop_verify_logdir
hadoop_status_daemon "${daemon_pidfile}"
if [[ $? == 0 ]]; then
- hadoop_error "${daemonname} is running as process $(cat "${daemon_pidfile}"). Stop it first."
+ hadoop_error "${daemonname} is running as process $(cat "${daemon_pidfile}"). Stop it first and ensure ${daemon_pidfile} file is empty before retry."
exit 1
else
# stale pid file, so just remove it and continue on