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
This commit is contained in:
Tim Burke 2017-07-19 09:55:26 -07:00
parent d93433dfb8
commit ab70350403

View File

@ -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