From ab7035040319d8b145e1ad4ffcefa184ad6bd8a9 Mon Sep 17 00:00:00 2001 From: Tim Burke Date: Wed, 19 Jul 2017 09:55:26 -0700 Subject: [PATCH] When configuring temp urls, give Swift time to start up Otherwise, we've seen intermittent "Unable to establish connection" failures, with the main devstack log reporting things like 2017-07-19 13:54:29.973 -> start proxy service 2017-07-19 13:54:30.082 -> start OSC to store temp url key 2017-07-19 13:54:31.908 -> OSC reports failure Meanwhile, the s-proxy screen session tells us things like Jul 19 13:54:31.919988 -> start child worker Jul 19 13:54:32.206598 -> still loading the WSGI app ... and ports aren't actually bound until *after* the app is loaded. Add a wait_for_service call to wait for the proxy to come up. Change-Id: I1a722de31b144797230991700e110353a2d937dd --- lib/swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/swift b/lib/swift index fc09093925..455740ea82 100644 --- a/lib/swift +++ b/lib/swift @@ -846,6 +846,14 @@ function start_swift { fi run_process s-proxy "$SWIFT_BIN_DIR/swift-proxy-server ${SWIFT_CONF_DIR}/proxy-server.conf -v" + # We also started the storage services, but proxy started last and + # will take the longest to start, so by the time it comes up, we're + # probably fine. + echo "Waiting for swift proxy to start..." + if ! wait_for_service $SERVICE_TIMEOUT $SWIFT_SERVICE_PROTOCOL://$SERVICE_HOST:$SWIFT_DEFAULT_BIND_PORT/info; then + die $LINENO "swift proxy did not start" + fi + if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then swift_configure_tempurls fi