Skip to content
Snippets Groups Projects
Commit 69553b95 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Fix race condition in haproxy"

parents c4d3726e f1111237
No related branches found
No related tags found
No related merge requests found
......@@ -4,11 +4,16 @@
echo "Running command: '${CMD}'"
$CMD
# TODO(SamYaple): This has the potential for a race condition triggered by a
# config reload that could cause the container to exit
while [[ -e "/proc/$(cat /run/haproxy.pid)" ]]; do
retry=0
# The loop breaks only when haproxy.pid get missing even after 3 re-try.
while [[ $retry -lt 3 ]]; do
if [[ ! -e /run/haproxy.pid || ! -d /proc/$(cat /run/haproxy.pid) ]]; then
retry=$((retry+1))
sleep 2
continue
fi
retry=0
sleep 5
done
# Based on the above loop this point should never be reached
exit 1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment