Commit b0679394 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Set backend health good if we stop polling the health.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5096 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent edad04f9
......@@ -557,10 +557,14 @@ VBP_Stop(struct backend *b, struct vrt_backend_probe const *p)
/* No more polling for this backend */
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;
vsb_delete(vt->vsb);
......
......@@ -396,7 +396,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));
VDI_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
......@@ -112,9 +112,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);
}
......@@ -155,6 +152,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->name);
/* XXX: MEMLEAK (?) (VSS ??) */
......
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