Eliminate race from call_weave; call check_running only after curl fails

This commit is contained in:
Bryan Boreham committed 2016-04-05 17:54:18 +01:00
1 parent ff4d0dae70
commit 934ec2467d
1 file changed
+8 -2
+8 -2
View File
@@ -1080,8 +1080,14 @@ http_call_unix() {
}
call_weave() {
check_running $CONTAINER_NAME || return 1
http_call $HTTP_ADDR "$@"
TMPERR=/tmp/call_weave_err_$$
retval=0
http_call $HTTP_ADDR "$@" 2>$TMPERR || retval=$?
if [ $retval -ne 0 ] ; then
check_running $CONTAINER_NAME && cat $TMPERR >&2
fi
rm -f $TMPERR
return $retval
}
death_msg() {