diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-03-20 16:17:28 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-03-20 16:17:28 +0000 |
| commit | 69553b95f10fa32d414264b45cd21af66112eae5 (patch) | |
| tree | 7901906d1e16c48d9355a932dc4c79f650e231bc /docker | |
| parent | c4d3726e10780f55f0338ba00879097172267745 (diff) | |
| parent | f11112371d50a604829e8a6c5c333e87ea94185f (diff) | |
| download | kolla-69553b95f10fa32d414264b45cd21af66112eae5.tar.gz kolla-69553b95f10fa32d414264b45cd21af66112eae5.zip | |
Merge "Fix race condition in haproxy"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/haproxy/extend_start.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/docker/haproxy/extend_start.sh b/docker/haproxy/extend_start.sh index c1914bb9e..e2d13f484 100644 --- a/docker/haproxy/extend_start.sh +++ b/docker/haproxy/extend_start.sh @@ -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 |
