Skip to content

Commit

Permalink
http1_deliver: Log client write error
Browse files Browse the repository at this point in the history
There is otherwise nothing but Debug logs when send_timeout triggers in
the request logs, and only the session logs can help understand partial
deliveries.

This introduces a client counterpart for:

    FetchError backend write error: %d (%s) (%s)
  • Loading branch information
dridi committed Jan 19, 2024
1 parent 9e8871e commit c0f6e31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion bin/varnishd/http1/cache_http1_deliver.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ V1D_Deliver(struct req *req, struct boc *boc, int sendbody)

if (sc == SC_NULL && err && req->sp->fd >= 0)
sc = SC_REM_CLOSE;
if (sc != SC_NULL)
if (sc != SC_NULL) {
VSLb(req->vsl, SLT_Error, "client write error: %d (%s) (%s)",
errno, VAS_errtxt(errno), sc->desc);
Req_Fail(req, sc);
}
if (req->doclose == SC_NULL)
req->doclose = sc;
}
14 changes: 10 additions & 4 deletions bin/varnishtest/tests/r03189.vtc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ server s1 {
chunkedlen 0
} -start

varnish v1 \
-arg "-p idle_send_timeout=.1" \
-arg "-p send_timeout=.8" \
-vcl+backend { } -start
varnish v1 -cliok "param.set idle_send_timeout .1"
varnish v1 -cliok "param.set send_timeout .8"
varnish v1 -vcl+backend { } -start

logexpect l1 -v v1 {
expect * * Error "client write error: .* .Error transaction."
expect 0 = Timestamp "Resp:"
} -start

client c1 {
txreq
Expand All @@ -26,3 +30,5 @@ client c1 {
barrier b sync
expect_close
} -run

logexpect l1 -wait

0 comments on commit c0f6e31

Please sign in to comment.