Skip to content

Commit

Permalink
Revert "immediately return from RMQ starting"
Browse files Browse the repository at this point in the history
This reverts commit 36d7db6feb20feefad519b4b0be5ccdc112462b6.

Change-Id: I4a87612368edcf80c30c39cb6cd650fc63c077a0
  • Loading branch information
mo-ki committed Feb 13, 2025
1 parent 5d4a3f0 commit f4694ed
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions omd/packages/rabbitmq/skel/etc/init.d/rabbitmq
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,32 @@ await_process_stop() {
return 1
}

rabbitmq_accepting_connections() {
"${RABBITMQ_DIAGNOSTICS}" check_port_listener --node "${RABBITMQ_NODENAME}" "${RABBITMQ_PORT}"
# no idea why we can't use this anymore; it will fail for the management plugin
# "${RABBITMQ_DIAGNOSTICS}" check_port_connectivity --node "${RABBITMQ_NODENAME}"
}

await_process_start() {
# Only write output in the end, otherwise we clobber the logfile.
max=$(("${1}" * 10))
# If the PIDFILE gets filled, rabbitmq started
for N in $(seq "${max}"); do
[ $((N % 10)) -eq 0 ] && printf "."
[ -s "${PIDFILE}" ] && return 0
[ -e "${PIDFILE}" ] || return 1
[ -s "${PIDFILE}" ] && rabbitmq_accepting_connections &>/dev/null && break
[ -e "${PIDFILE}" ] || {
date +"%F %T.%N RabbitMQ failed to start (pidfile vanished)"
return 1
}
sleep 0.1
done

# once again, mostly to get the output of the diagnostics call
[ -s "${PIDFILE}" ] && rabbitmq_accepting_connections && {
date +"%F %T.%N RabbitMQ considered ready"
return 0
}

date +"%F %T.%N RabbitMQ failed to start (giving up after timeout)"
return 1
}

Expand Down

0 comments on commit f4694ed

Please sign in to comment.