Skip to content

Commit 3d6fd2f

Browse files
committed
v1d: Log delivery errors
1 parent 3233bd2 commit 3d6fd2f

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

bin/varnishd/http1/cache_http1_deliver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)
142142

143143
if (sc == SC_NULL && err && req->sp->fd >= 0)
144144
sc = SC_REM_CLOSE;
145-
if (sc != SC_NULL)
145+
if (sc != SC_NULL) {
146+
VSLb(req->vsl, SLT_DeliveryError, "resp: \"%s\" %d \"%s\"",
147+
sc->desc, errno, VAS_errtxt(errno));
146148
Req_Fail(req, sc);
149+
}
147150
}

bin/varnishtest/tests/r03189.vtc

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ server s1 {
1414
chunkedlen 0
1515
} -start
1616

17-
varnish v1 \
18-
-arg "-p idle_send_timeout=.1" \
19-
-arg "-p send_timeout=.8" \
20-
-vcl+backend { } -start
17+
varnish v1 -cliok "param.set idle_send_timeout .1"
18+
varnish v1 -cliok "param.set send_timeout .8"
19+
varnish v1 -vcl+backend { } -start
20+
21+
logexpect l1 -v v1 {
22+
expect * * DeliveryError {resp: "Error transaction" \d+ ".*"}
23+
expect 0 = Timestamp "Resp:"
24+
} -start
2125

2226
client c1 {
2327
txreq
@@ -26,3 +30,5 @@ client c1 {
2630
barrier b sync
2731
expect_close
2832
} -run
33+
34+
logexpect l1 -wait

0 commit comments

Comments
 (0)