Commit 5e1595df authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r5096: Set backend health good if we stop polling the health.


git-svn-id: http://www.varnish-cache.org/svn/branches/2.1@5311 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 1ad39f67
......@@ -478,10 +478,14 @@ VBP_Stop(struct backend *b)
CHECK_OBJ_NOTNULL(b->probe, VBP_TARGET_MAGIC);
vt = b->probe;
b->healthy = 1;
vt->stop = 1;
AZ(pthread_cancel(vt->thread));
AZ(pthread_join(vt->thread, &ret));
b->healthy = 1;
VTAILQ_REMOVE(&vbp_list, vt, list);
b->probe = NULL;
FREE_OBJ(vt);
......
......@@ -397,7 +397,7 @@ FetchHdr(struct sess *sp)
i = HTC_Rx(sp->wrk->htc);
if (i < 0) {
WSP(sp, SLT_FetchError,
"http read error: %d", errno);
"http read error: %d (%s)", errno, strerror(errno));
VBE_CloseFd(sp);
/* XXX: other cleanup ? */
return (__LINE__);
......
# $Id$
test "Dropping polling of a backend"
server s1 -repeat 1 {
rxreq
txresp
} -start
varnish v1 -vcl {
backend s1 {
.host = "${s1_addr}";
.port = "${s1_port}";
.probe = {
.window = 8;
.initial = 7;
.threshold = 8;
.interval = 0.1s;
}
}
} -start
delay 1
varnish v1 -vcl {
backend s1 {
.host = "${s1_addr}";
.port = "${s1_port}";
}
} -cliok "vcl.use vcl2" -cliok "vcl.discard vcl1"
delay .5
varnish v1 -cliok "vcl.list"
varnish v1 -cliok "debug.health"
server s1 {
rxreq
expect req.url == /foo
txresp -bodylen 4
} -start
client c1 {
txreq -url /foo
rxresp
expect resp.status == 200
expect resp.bodylen == 4
} -run
......@@ -110,9 +110,6 @@ server_thread(void *priv)
vtc_log(vl, 0, "Shutdown failed: %s", strerror(errno));
TCP_close(&fd);
}
macro_def(s->vl, s->name, "addr", NULL);
macro_def(s->vl, s->name, "port", NULL);
macro_def(s->vl, s->name, "sock", NULL);
vtc_log(vl, 2, "Ending");
return (NULL);
}
......@@ -153,6 +150,9 @@ server_delete(struct server *s)
{
CHECK_OBJ_NOTNULL(s, SERVER_MAGIC);
macro_def(s->vl, s->name, "addr", NULL);
macro_def(s->vl, s->name, "port", NULL);
macro_def(s->vl, s->name, "sock", NULL);
vtc_logclose(s->vl);
free(s->listen);
free(s->name);
......
......@@ -227,8 +227,8 @@ vcl_output_lang_h(struct vsb *sb)
vsb_cat(sb, " * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWI");
vsb_cat(sb, "SE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFT");
vsb_cat(sb, "WARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n");
vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 5047 2010-07-13 11:");
vsb_cat(sb, "07:00Z tfheen $\n *\n * Runtime support for compiled V");
vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 5310 2010-09-28 11:");
vsb_cat(sb, "51:44Z tfheen $\n *\n * Runtime support for compiled V");
vsb_cat(sb, "CL programs.\n *\n * XXX: When this file is changed, l");
vsb_cat(sb, "ib/libvcl/vcc_gen_fixed_token.tcl\n");
vsb_cat(sb, " * XXX: *MUST* be rerun.\n */\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment