Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
1c82be0c
Commit
1c82be0c
authored
Jun 25, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a regression in panic output.
Update test-case to exercise more of the panic formatter.
parent
90846c4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
18 deletions
+46
-18
cache_main.c
bin/varnishd/cache/cache_main.c
+0
-2
cache_panic.c
bin/varnishd/cache/cache_panic.c
+12
-12
cache_session.c
bin/varnishd/cache/cache_session.c
+2
-2
v00010.vtc
bin/varnishtest/tests/v00010.vtc
+32
-2
No files found.
bin/varnishd/cache/cache_main.c
View file @
1c82be0c
...
...
@@ -45,7 +45,6 @@ volatile struct params *cache_param;
* the thread. This is used for panic messages.
*/
static
pthread_key_t
sp_key
;
static
pthread_key_t
req_key
;
void
...
...
@@ -126,7 +125,6 @@ child_main(void)
cache_param
=
heritage
.
param
;
AZ
(
pthread_key_create
(
&
sp_key
,
NULL
));
AZ
(
pthread_key_create
(
&
req_key
,
NULL
));
AZ
(
pthread_key_create
(
&
name_key
,
NULL
));
...
...
bin/varnishd/cache/cache_panic.c
View file @
1c82be0c
...
...
@@ -182,12 +182,12 @@ pan_vcl(const struct VCL_conf *vcl)
{
int
i
;
VSB_printf
(
pan_vsp
,
"
vcl = {
\n
"
);
VSB_printf
(
pan_vsp
,
"
srcname = {
\n
"
);
VSB_printf
(
pan_vsp
,
" vcl = {
\n
"
);
VSB_printf
(
pan_vsp
,
" srcname = {
\n
"
);
for
(
i
=
0
;
i
<
vcl
->
nsrc
;
++
i
)
VSB_printf
(
pan_vsp
,
"
\"
%s
\"
,
\n
"
,
vcl
->
srcname
[
i
]);
VSB_printf
(
pan_vsp
,
" },
\n
"
);
VSB_printf
(
pan_vsp
,
"
\"
%s
\"
,
\n
"
,
vcl
->
srcname
[
i
]);
VSB_printf
(
pan_vsp
,
" },
\n
"
);
VSB_printf
(
pan_vsp
,
" },
\n
"
);
}
...
...
@@ -224,7 +224,7 @@ pan_busyobj(const struct busyobj *bo)
pan_http
(
"bereq"
,
bo
->
bereq
,
4
);
if
(
bo
->
beresp
->
ws
!=
NULL
)
pan_http
(
"beresp"
,
bo
->
beresp
,
4
);
VSB_printf
(
pan_vsp
,
" }
\n
"
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -272,7 +272,7 @@ pan_req(const struct req *req)
pan_ws
(
req
->
ws
,
2
);
pan_http
(
"req"
,
req
->
http
,
2
);
if
(
req
->
resp
->
ws
!=
NULL
)
pan_http
(
"resp"
,
req
->
resp
,
4
);
pan_http
(
"resp"
,
req
->
resp
,
2
);
if
(
VALID_OBJ
(
req
->
vcl
,
VCL_CONF_MAGIC
))
pan_vcl
(
req
->
vcl
);
...
...
@@ -293,10 +293,10 @@ pan_sess(const struct sess *sp)
{
const
char
*
stp
;
VSB_printf
(
pan_vsp
,
"sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
" fd = %d, id = %u,
\n
"
,
VSB_printf
(
pan_vsp
,
"
sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
"
fd = %d, id = %u,
\n
"
,
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
);
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
VSB_printf
(
pan_vsp
,
"
client = %s %s,
\n
"
,
sp
->
addr
?
sp
->
addr
:
"?.?.?.?"
,
sp
->
port
?
sp
->
port
:
"?"
);
switch
(
sp
->
sess_step
)
{
...
...
@@ -306,11 +306,11 @@ pan_sess(const struct sess *sp)
default:
stp
=
NULL
;
}
if
(
stp
!=
NULL
)
VSB_printf
(
pan_vsp
,
" step = %s,
\n
"
,
stp
);
VSB_printf
(
pan_vsp
,
"
step = %s,
\n
"
,
stp
);
else
VSB_printf
(
pan_vsp
,
" step = 0x%x,
\n
"
,
sp
->
sess_step
);
VSB_printf
(
pan_vsp
,
"
step = 0x%x,
\n
"
,
sp
->
sess_step
);
VSB_printf
(
pan_vsp
,
"},
\n
"
);
VSB_printf
(
pan_vsp
,
"
},
\n
"
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_session.c
View file @
1c82be0c
...
...
@@ -134,6 +134,7 @@ ses_pool_task(struct worker *wrk, void *arg)
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
THR_SetRequest
(
req
);
AZ
(
wrk
->
aws
->
r
);
wrk
->
lastused
=
NAN
;
CNT_Session
(
wrk
,
req
);
...
...
@@ -143,6 +144,7 @@ ses_pool_task(struct worker *wrk, void *arg)
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
}
THR_SetRequest
(
NULL
);
}
/*--------------------------------------------------------------------
...
...
@@ -315,7 +317,6 @@ ses_GetReq(struct sess *sp)
AN
(
req
);
req
->
magic
=
REQ_MAGIC
;
req
->
sp
=
sp
;
THR_SetRequest
(
req
);
e
=
(
char
*
)
req
+
sz
;
p
=
(
char
*
)(
req
+
1
);
...
...
@@ -374,7 +375,6 @@ SES_ReleaseReq(struct req *req)
VSL_Flush
(
req
->
vsl
,
0
);
req
->
sp
=
NULL
;
MPL_Free
(
pp
->
mpl_req
,
req
);
THR_SetRequest
(
NULL
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishtest/tests/v00010.vtc
View file @
1c82be0c
...
...
@@ -4,7 +4,15 @@ server s1 {
rxreq
txresp -hdr "Foo: bar" -body "abcdef\n"
rxreq
txresp -hdr "Panic: please" -body "012345\n"
txresp -hdr "Panic: fetch" -body "012345\n"
close
sema r1 sync 2
accept
rxreq
txresp -hdr "Foo: bar" -body "abcdef\n"
rxreq
txresp -hdr "Panic: deliver" -body "012345\n"
close
sema r1 sync 2
...
...
@@ -17,8 +25,13 @@ varnish v1 -storage "-smalloc,1m" -vcl+backend {
import debug from "${topbuild}/lib/libvmod_debug/.libs/libvmod_debug.so";
sub vcl_fetch {
if (beresp.http.panic == "fetch") {
debug.panic("Had Panic header: " + beresp.http.panic);
}
}
sub vcl_deliver {
if (resp.http.panic) {
if (resp.http.panic
== "deliver"
) {
debug.panic("Had Panic header: " + resp.http.panic);
}
}
...
...
@@ -46,6 +59,23 @@ sema r1 sync 2
delay 0.5
client c1 {
txreq -url "/"
rxresp
txreq -url "/foo"
# Don't expect answer, the server crashed.
} -run
varnish v1 -wait-stopped
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
varnish v1 -clierr 300 "panic.clear"
varnish v1 -cliok "start"
varnish v1 -wait-running
sema r1 sync 2
delay 0.5
client c1 {
txreq -url "/"
rxresp
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment