[master] a0e68b3 Change vcl_error{} to do a direct response without going the detour over a bogo-object.
Poul-Henning Kamp
phk at FreeBSD.org
Tue Mar 11 11:50:08 CET 2014
commit a0e68b31df6eeba8634e1a436cccb176e889a33f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Mar 11 10:48:53 2014 +0000
Change vcl_error{} to do a direct response without going the detour
over a bogo-object.
This means that vcl_error{} looses access to obj.* variables, but
gains access to resp.* vaiables instead.
A couple of now obsolute test-cases retired.
diff --git a/bin/varnishd/builtin.vcl b/bin/varnishd/builtin.vcl
index 96d74ea..da30346 100644
--- a/bin/varnishd/builtin.vcl
+++ b/bin/varnishd/builtin.vcl
@@ -135,19 +135,19 @@ sub vcl_deliver {
* We can come here "invisibly" with the following errors: 413, 417 & 503
*/
sub vcl_error {
- set obj.http.Content-Type = "text/html; charset=utf-8";
- set obj.http.Retry-After = "5";
+ set resp.http.Content-Type = "text/html; charset=utf-8";
+ set resp.http.Retry-After = "5";
synthetic( {"
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
- <title>"} + obj.status + " " + obj.reason + {"</title>
+ <title>"} + resp.status + " " + resp.reason + {"</title>
</head>
<body>
- <h1>Error "} + obj.status + " " + obj.reason + {"</h1>
- <p>"} + obj.reason + {"</p>
+ <h1>Error "} + resp.status + " " + resp.reason + {"</h1>
+ <p>"} + resp.reason + {"</p>
<h3>Guru Meditation:</h3>
<p>XID: "} + req.xid + {"</p>
<hr>
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index c3cefac..3aabd8d 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -669,9 +669,8 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
if (wrk->handling == VCL_RET_RETRY) {
VSB_delete(bo->synth_body);
bo->synth_body = NULL;
- if (bo->retries++ < cache_param->max_retries) {
+ if (bo->retries++ < cache_param->max_retries)
return (F_STP_RETRY);
- }
bo->synth_body = NULL;
HSH_Fail(bo->fetch_objcore);
VBO_setstate(bo, BOS_FAILED);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index f5ae189..467ea8d 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -187,56 +187,29 @@ DOT }
static enum req_fsm_nxt
cnt_error(struct worker *wrk, struct req *req)
{
- struct http *h;
- struct busyobj *bo;
char date[40];
- ssize_t l;
- struct storage *st;
+ struct http *h;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
- AZ(req->objcore);
- AZ(req->obj);
req->acct_req.error++;
- bo = VBO_GetBusyObj(wrk, req);
- AZ(bo->stats);
- bo->stats = &wrk->stats;
- bo->fetch_objcore = HSH_Private(wrk);
- bo->fetch_obj = STV_NewObject(bo,
- TRANSIENT_STORAGE, cache_param->http_resp_size,
- (uint16_t)cache_param->http_max_hdr);
- req->obj = bo->fetch_obj;
- if (req->obj == NULL) {
- req->doclose = SC_OVERLOAD;
- req->director_hint = NULL;
- AZ(HSH_DerefObjCore(&wrk->stats, &bo->fetch_objcore));
- bo->fetch_objcore = NULL;
- http_Teardown(bo->beresp);
- http_Teardown(bo->bereq);
- bo->stats = NULL;
- VBO_DerefBusyObj(wrk, &bo);
- return (REQ_FSM_DONE);
- }
- CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
- AZ(req->objcore);
- req->obj->vxid = bo->vsl->wid;
- req->obj->exp.t_origin = req->t_req;
- h = req->obj->http;
+ HTTP_Setup(req->resp, req->ws, req->vsl, SLT_RespMethod);
+ h = req->resp;
+ req->t_resp = VTIM_real();
if (req->err_code < 100 || req->err_code > 999)
req->err_code = 501;
+ http_ClrHeader(h);
http_PutProtocol(h, "HTTP/1.1");
http_PutStatus(h, req->err_code);
- VTIM_format(W_TIM_real(wrk), date);
+ VTIM_format(req->t_resp, date);
http_PrintfHeader(h, "Date: %s", date);
http_SetHeader(h, "Server: Varnish");
-
- CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
- HSH_Ref(req->obj->objcore);
-
+ http_PrintfHeader(req->resp,
+ "X-Varnish: %u", req->vsl->wid & VSL_IDENTMASK);
if (req->err_reason != NULL)
http_PutResponse(h, req->err_reason);
else
@@ -248,56 +221,27 @@ cnt_error(struct worker *wrk, struct req *req)
VCL_error_method(req->vcl, wrk, req, NULL, req->http->ws);
- http_Unset(req->obj->http, H_Content_Length);
+ http_Unset(h, H_Content_Length);
AZ(VSB_finish(req->synth_body));
- /* Stop the insanity before it turns "Hotel California" on us */
- if (req->restarts >= cache_param->max_restarts)
- wrk->handling = VCL_RET_DELIVER;
-
if (wrk->handling == VCL_RET_RESTART) {
+ http_ClrHeader(h);
VSB_delete(req->synth_body);
req->synth_body = NULL;
- bo->stats = NULL;
- VBO_DerefBusyObj(wrk, &bo);
- HSH_Drop(wrk, &req->obj);
req->req_step = R_STP_RESTART;
return (REQ_FSM_MORE);
}
- CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
-
- /* We always close when we take this path */
- req->doclose = SC_TX_ERROR;
- req->wantbody = 1;
-
assert(wrk->handling == VCL_RET_DELIVER);
- l = VSB_len(req->synth_body);
- if (l > 0) {
- st = STV_alloc(bo, l);
- if (st != NULL) {
- VTAILQ_INSERT_TAIL(&req->obj->store, st, list);
- if (st->space >= l) {
- memcpy(st->ptr, VSB_data(req->synth_body), l);
- st->len = l;
- req->obj->len = l;
- }
- }
- }
+ V1D_Deliver_Synth(req);
VSB_delete(req->synth_body);
req->synth_body = NULL;
req->err_code = 0;
req->err_reason = NULL;
- http_Teardown(bo->bereq);
- CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
- bo->stats = NULL;
- VBO_DerefBusyObj(wrk, &bo);
- req->req_step = R_STP_DELIVER;
- CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
- return (REQ_FSM_MORE);
+ return (REQ_FSM_DONE);
}
/*--------------------------------------------------------------------
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index b6e2835..8a999c9 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -62,7 +62,7 @@ vrt_do_string(const struct http *hp, int fld,
va_end(ap);
}
-#define VRT_DO_HDR(obj, hdr, fld) \
+#define VRT_HDR_L(obj, hdr, fld) \
void \
VRT_l_##obj##_##hdr(const struct vrt_ctx *ctx, const char *p, ...) \
{ \
@@ -72,8 +72,9 @@ VRT_l_##obj##_##hdr(const struct vrt_ctx *ctx, const char *p, ...) \
va_start(ap, p); \
vrt_do_string(ctx->http_##obj, fld, #obj "." #hdr, p, ap); \
va_end(ap); \
-} \
- \
+}
+
+#define VRT_HDR_R(obj, hdr, fld) \
const char * \
VRT_r_##obj##_##hdr(const struct vrt_ctx *ctx) \
{ \
@@ -82,7 +83,11 @@ VRT_r_##obj##_##hdr(const struct vrt_ctx *ctx) \
return (ctx->http_##obj->hd[fld].b); \
}
-#define VRT_DO_STATUS(obj) \
+#define VRT_HDR_LR(obj, hdr, fld) \
+ VRT_HDR_L(obj, hdr, fld) \
+ VRT_HDR_R(obj, hdr, fld)
+
+#define VRT_STATUS_L(obj) \
void \
VRT_l_##obj##_status(const struct vrt_ctx *ctx, long num) \
{ \
@@ -91,8 +96,9 @@ VRT_l_##obj##_status(const struct vrt_ctx *ctx, long num) \
CHECK_OBJ_NOTNULL(ctx->http_##obj, HTTP_MAGIC); \
assert(num >= 100 && num <= 999); \
ctx->http_##obj->status = (uint16_t)num; \
-} \
- \
+}
+
+#define VRT_STATUS_R(obj) \
long \
VRT_r_##obj##_status(const struct vrt_ctx *ctx) \
{ \
@@ -102,22 +108,26 @@ VRT_r_##obj##_status(const struct vrt_ctx *ctx) \
return(ctx->http_##obj->status); \
}
-VRT_DO_HDR(req, method, HTTP_HDR_METHOD)
-VRT_DO_HDR(req, url, HTTP_HDR_URL)
-VRT_DO_HDR(req, proto, HTTP_HDR_PROTO)
-VRT_DO_HDR(obj, proto, HTTP_HDR_PROTO)
-VRT_DO_HDR(obj, reason, HTTP_HDR_RESPONSE)
-VRT_DO_STATUS(obj)
-VRT_DO_HDR(resp, proto, HTTP_HDR_PROTO)
-VRT_DO_HDR(resp, reason, HTTP_HDR_RESPONSE)
-VRT_DO_STATUS(resp)
-
-VRT_DO_HDR(bereq, method, HTTP_HDR_METHOD)
-VRT_DO_HDR(bereq, url, HTTP_HDR_URL)
-VRT_DO_HDR(bereq, proto, HTTP_HDR_PROTO)
-VRT_DO_HDR(beresp, proto, HTTP_HDR_PROTO)
-VRT_DO_HDR(beresp, reason, HTTP_HDR_RESPONSE)
-VRT_DO_STATUS(beresp)
+VRT_HDR_LR(req, method, HTTP_HDR_METHOD)
+VRT_HDR_LR(req, url, HTTP_HDR_URL)
+VRT_HDR_LR(req, proto, HTTP_HDR_PROTO)
+
+VRT_HDR_R(obj, proto, HTTP_HDR_PROTO)
+VRT_HDR_R(obj, reason, HTTP_HDR_RESPONSE)
+VRT_STATUS_R(obj)
+
+VRT_HDR_LR(resp, proto, HTTP_HDR_PROTO)
+VRT_HDR_LR(resp, reason, HTTP_HDR_RESPONSE)
+VRT_STATUS_L(resp)
+VRT_STATUS_R(resp)
+
+VRT_HDR_LR(bereq, method, HTTP_HDR_METHOD)
+VRT_HDR_LR(bereq, url, HTTP_HDR_URL)
+VRT_HDR_LR(bereq, proto, HTTP_HDR_PROTO)
+VRT_HDR_LR(beresp, proto, HTTP_HDR_PROTO)
+VRT_HDR_LR(beresp, reason, HTTP_HDR_RESPONSE)
+VRT_STATUS_L(beresp)
+VRT_STATUS_R(beresp)
/*--------------------------------------------------------------------*/
diff --git a/bin/varnishtest/tests/b00017.vtc b/bin/varnishtest/tests/b00017.vtc
index faac1e8..dbe673b 100644
--- a/bin/varnishtest/tests/b00017.vtc
+++ b/bin/varnishtest/tests/b00017.vtc
@@ -1,4 +1,4 @@
-varnishtest "Check that we close one error"
+varnishtest "Check that we do not close one error"
varnish v1 -vcl {
backend foo {
@@ -19,7 +19,7 @@ client c1 {
rxresp
expect resp.status == 888
expect resp.bodylen == 31
- expect resp.http.connection == close
+ expect resp.http.connection != close
} -run
varnish v1 -expect s_error == 1
diff --git a/bin/varnishtest/tests/b00019.vtc b/bin/varnishtest/tests/b00019.vtc
index 597e8b9..59ceb61 100644
--- a/bin/varnishtest/tests/b00019.vtc
+++ b/bin/varnishtest/tests/b00019.vtc
@@ -27,14 +27,14 @@ varnish v1 -vcl+backend {
sub vcl_error {
if (req.restarts == 2) {
- set obj.status = 200;
- set obj.reason = "restart=2";
+ set resp.status = 200;
+ set resp.reason = "restart=2";
} elsif (req.restarts > 2) {
- set obj.status = 501;
- set obj.reason = "restart>2";
+ set resp.status = 501;
+ set resp.reason = "restart>2";
} elsif (req.restarts < 2) {
- set obj.status = 500;
- set obj.reason = "restart<2";
+ set resp.status = 500;
+ set resp.reason = "restart<2";
}
}
} -start
diff --git a/bin/varnishtest/tests/b00030.vtc b/bin/varnishtest/tests/b00030.vtc
index 8b945e1..a7b6c57 100644
--- a/bin/varnishtest/tests/b00030.vtc
+++ b/bin/varnishtest/tests/b00030.vtc
@@ -13,7 +13,7 @@ varnish v1 -vcl+backend {
return (error(200,req.ttl));
}
sub vcl_error {
- set obj.http.x-timestamp = now;
+ set resp.http.x-timestamp = now;
}
} -start
diff --git a/bin/varnishtest/tests/c00024.vtc b/bin/varnishtest/tests/c00024.vtc
index 2a1e542..6167914 100644
--- a/bin/varnishtest/tests/c00024.vtc
+++ b/bin/varnishtest/tests/c00024.vtc
@@ -15,7 +15,7 @@ varnish v1 -vcl+backend {
if (req.restarts < 1) {
return (restart);
} else {
- set obj.status = 201;
+ set resp.status = 201;
}
}
} -start
diff --git a/bin/varnishtest/tests/c00061.vtc b/bin/varnishtest/tests/c00061.vtc
index ecb01a4..c99f324 100644
--- a/bin/varnishtest/tests/c00061.vtc
+++ b/bin/varnishtest/tests/c00061.vtc
@@ -9,7 +9,7 @@ varnish v1 -vcl {
}
sub vcl_error {
- set obj.status = 504;
+ set resp.status = 504;
}
} -start
diff --git a/bin/varnishtest/tests/r00310.vtc b/bin/varnishtest/tests/r00310.vtc
index 38c8a32..9d0c431 100644
--- a/bin/varnishtest/tests/r00310.vtc
+++ b/bin/varnishtest/tests/r00310.vtc
@@ -1,6 +1,6 @@
varnishtest "Test obj.http.x-cache in vcl_hit"
-varnish v1 -errvcl {'obj.http.x-cache': cannot be set in method 'vcl_hit'.} {
+varnish v1 -errvcl {Variable 'obj.http.x-cache' is read only.} {
backend foo { .host = "127.0.0.1"; }
sub vcl_hit {
diff --git a/bin/varnishtest/tests/r00769.vtc b/bin/varnishtest/tests/r00769.vtc
index 838ef17..451029c 100644
--- a/bin/varnishtest/tests/r00769.vtc
+++ b/bin/varnishtest/tests/r00769.vtc
@@ -17,9 +17,9 @@ varnish v1 -vcl+backend {
return (deliver);
}
sub vcl_error {
- if (obj.status == 700) {
- set obj.status=404;
- set obj.http.X-status = obj.status;
+ if (resp.status == 700) {
+ set resp.status=404;
+ set resp.http.X-status = resp.status;
return (deliver);
}
}
diff --git a/bin/varnishtest/tests/r00965.vtc b/bin/varnishtest/tests/r00965.vtc
index ccd01b5..d9cbdba 100644
--- a/bin/varnishtest/tests/r00965.vtc
+++ b/bin/varnishtest/tests/r00965.vtc
@@ -28,7 +28,7 @@ varnish v1 -vcl+backend {
}
sub vcl_error {
- if (obj.status == 988) { return (restart); }
+ if (resp.status == 988) { return (restart); }
}
sub vcl_miss {
diff --git a/bin/varnishtest/tests/r01031.vtc b/bin/varnishtest/tests/r01031.vtc
deleted file mode 100644
index 27bbab2..0000000
--- a/bin/varnishtest/tests/r01031.vtc
+++ /dev/null
@@ -1,30 +0,0 @@
-varnishtest "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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
-} -run
-
-varnish v1 -cliok "param.set http_resp_size 256"
-
-client c2 {
- txreq -req GET
- rxresp
- expect resp.status == 200
- expect resp.msg == "Lost Response"
-} -run
diff --git a/bin/varnishtest/tests/r01283.vtc b/bin/varnishtest/tests/r01283.vtc
deleted file mode 100644
index 9b843ce..0000000
--- a/bin/varnishtest/tests/r01283.vtc
+++ /dev/null
@@ -1,48 +0,0 @@
-varnishtest "#1283 - Test failure to allocate object for error (transient full)"
-
-server s1 {
- rxreq
- txresp -bodylen 1048198
-} -start
-
-varnish v1 \
- -arg "-p nuke_limit=0" \
- -arg "-sTransient=malloc,1m" \
- -vcl+backend {
- sub vcl_recv {
- if (req.http.x-do-error) {
- return (error(500));
- }
- }
- sub vcl_backend_response {
- set beresp.do_stream = false;
- set beresp.storage_hint = "Transient";
- }
-} -start
-
-client c1 {
- # Fill transient
- txreq
- rxresp
- expect resp.status == 200
-} -run
-
-varnish v1 -expect SMA.Transient.g_bytes > 1048000
-varnish v1 -expect SMA.Transient.g_space < 200
-varnish v1 -expect SMA.Transient.c_fail == 0
-
-client c1 {
- # Trigger vcl_error. Don't wait for reply as Varnish will not send one
- # due to Transient full
- txreq -hdr "X-Do-Error: true"
- delay 1
-} -run
-
-varnish v1 -expect SMA.Transient.c_fail == 1
-
-client c1 {
- # Check that Varnish is still alive
- txreq
- rxresp
- expect resp.status == 200
-} -run
diff --git a/bin/varnishtest/tests/r01284.vtc b/bin/varnishtest/tests/r01284.vtc
index 123ddb2..f89b579 100644
--- a/bin/varnishtest/tests/r01284.vtc
+++ b/bin/varnishtest/tests/r01284.vtc
@@ -42,8 +42,8 @@ client c1 {
delay 1
} -run
-# Three failures, one for obj2, one for vcl_backend_error{} and for vcl_error{}
-varnish v1 -expect SMA.Transient.c_fail == 3
+# Three failures, one for obj2, one for vcl_backend_error{}
+varnish v1 -expect SMA.Transient.c_fail == 2
client c1 {
# Check that Varnish is still alive
diff --git a/bin/varnishtest/tests/r01287.vtc b/bin/varnishtest/tests/r01287.vtc
index fc1ebd2..7e329ac 100644
--- a/bin/varnishtest/tests/r01287.vtc
+++ b/bin/varnishtest/tests/r01287.vtc
@@ -8,7 +8,7 @@ varnish v1 -vcl+backend {
return (error(200, "OK"));
}
sub vcl_error {
- synthetic(obj.http.blank);
+ synthetic(resp.http.blank);
return (deliver);
}
} -start
diff --git a/bin/varnishtest/tests/v00011.vtc b/bin/varnishtest/tests/v00011.vtc
index 162c66a..3a3d842 100644
--- a/bin/varnishtest/tests/v00011.vtc
+++ b/bin/varnishtest/tests/v00011.vtc
@@ -52,6 +52,5 @@ logexpect l1 -wait
client c1 {
txreq
rxresp
- expect resp.http.X-Varnish == "1007"
-
+ expect resp.http.X-Varnish == "1006"
} -run
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index c3f26ff..48b0175 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -490,8 +490,8 @@ The client's IP address.
),
('obj.proto',
'STRING',
- ( 'hit', 'error',),
- ( 'hit', 'error',), """
+ ( 'hit', ),
+ ( 'hit', ), """
The HTTP protocol version used when the object was retrieved.
"""
),
@@ -520,30 +520,30 @@ The client's IP address.
),
('obj.http.',
'HEADER',
- ( 'hit', 'error',),
- ( 'error',), """
+ ( 'hit', ),
+ ( ), """
The corresponding HTTP header.
"""
),
('obj.ttl',
'DURATION',
- ( 'hit', 'error',),
- ( 'hit', 'error',), """
+ ( 'hit', ),
+ ( 'hit', ), """
The object's remaining time to live, in seconds.
obj.ttl is writable.
"""
),
('obj.grace',
'DURATION',
- ( 'hit', 'error',),
- ( 'hit', 'error',), """
+ ( 'hit', ),
+ ( 'hit', ), """
The object's grace period in seconds. obj.grace is writable.
"""
),
('obj.keep',
'DURATION',
- ( 'hit', 'error',),
- ( 'hit', 'error',), """
+ ( 'hit', ),
+ ( 'hit', ), """
"""
),
('obj.last_use',
@@ -557,35 +557,35 @@ The client's IP address.
),
('obj.uncacheable',
'BOOL',
- ( 'hit', 'deliver', 'error',),
+ ( 'hit', ),
( ), """
"""
),
('resp.proto',
'STRING',
- ( 'deliver',),
- ( 'deliver',), """
+ ( 'deliver', 'error', ),
+ ( 'deliver', 'error', ), """
The HTTP protocol version to use for the response.
"""
),
('resp.status',
'INT',
- ( 'deliver',),
- ( 'deliver',), """
+ ( 'deliver', 'error', ),
+ ( 'deliver', 'error', ), """
The HTTP status code that will be returned.
"""
),
('resp.reason',
'STRING',
- ( 'deliver',),
- ( 'deliver',), """
+ ( 'deliver', 'error', ),
+ ( 'deliver', 'error', ), """
The HTTP status message that will be returned.
"""
),
('resp.http.',
'HEADER',
- ( 'deliver',),
- ( 'deliver',), """
+ ( 'deliver', 'error', ),
+ ( 'deliver', 'error', ), """
The corresponding HTTP header.
"""
),
More information about the varnish-commit
mailing list