Commit 4e5c8ab0 authored by Federico G. Schwindt's avatar Federico G. Schwindt

Fail gracefully if we can't get a backend on pipe

Fixes #1730
parent a8d06513
......@@ -277,6 +277,10 @@ vbe_dir_http1pipe(const struct director *d, struct req *req, struct busyobj *bo)
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
i = vbe_dir_getfd(d, bo);
if (i < 0) {
VSLb(bo->vsl, SLT_FetchError, "no backend connection");
return;
}
V1P_Process(req, bo, i);
vbe_dir_finish(d, bo->wrk, bo);
}
......
varnishtest "Test connection error on pipe"
varnish v1 -vcl {
backend default { .host = "${bad_ip}"; }
sub vcl_recv {
return (pipe);
}
} -start
client c1 {
txreq
expect_close
} -run
varnish v1 -expect sc_rx_timeout == 1
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