Skip to content

Commit 03fd0c2

Browse files
Merge pull request #532 from bogdando/bug/1529897
Remove unneeded sleep for a graceful stop by PID
2 parents 0c4d9a0 + 0f77ae3 commit 03fd0c2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

scripts/rabbitmq-server-ha.ocf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -933,16 +933,12 @@ stop_server_process() {
933933
# Try to stop gracefully by known PID
934934
ocf_log info "${LH} Execute stop with timeout: ${TIMEOUT_ARG}"
935935
su_rabbit_cmd "${OCF_RESKEY_ctl} stop ${OCF_RESKEY_pid_file} 2>&1 >> \"${OCF_RESKEY_log_dir}/shutdown_log\""
936-
if [ $? -eq 0 ] ; then
937-
ocf_log info "${LH} RMQ-server process (PID=${pid}) stopped succesfully."
938-
ocf_log info "${LH} grant a graceful termintation window ${OCF_RESKEY_stop_time} to end its beam and remove pidfile"
939-
sleep "${OCF_RESKEY_stop_time}"
940-
fi
936+
[ $? -eq 0 ] && ocf_log info "${LH} RMQ-server process (PID=${pid}) stopped succesfully."
941937
fi
942938

943939
if [ -f ${OCF_RESKEY_pid_file} ] ; then
944940
# Ensure there is no beam process and pidfile left
945-
ocf_log warn "${LH} Cannot be stopped, forcing the RMQ-server process termination"
941+
ocf_log warn "${LH} The pidfile still exists, forcing the RMQ-server cleanup"
946942
kill_rmq_and_remove_pid
947943
fi
948944

0 commit comments

Comments
 (0)