Skip to content

Commit 0f77ae3

Browse files
author
Bogdan Dobrelya
committed
Remove unneeded sleep for a graceful stop by PID
The sleep in not needed according to the https://www.rabbitmq.com/man/rabbitmqctl.1.man.html "If a pid_file is specified, also waits for the process specified there to terminate." Related Fuel bug https://launchpad.net/bugs/1529897 Related PR #523 Signed-off-by: Bogdan Dobrelya <[email protected]>
1 parent 0c4d9a0 commit 0f77ae3

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)