Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
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
Show 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;
...
@@ -45,7 +45,6 @@ volatile struct params *cache_param;
* the thread. This is used for panic messages.
* the thread. This is used for panic messages.
*/
*/
static
pthread_key_t
sp_key
;
static
pthread_key_t
req_key
;
static
pthread_key_t
req_key
;
void
void
...
@@ -126,7 +125,6 @@ child_main(void)
...
@@ -126,7 +125,6 @@ child_main(void)
cache_param
=
heritage
.
param
;
cache_param
=
heritage
.
param
;
AZ
(
pthread_key_create
(
&
sp_key
,
NULL
));
AZ
(
pthread_key_create
(
&
req_key
,
NULL
));
AZ
(
pthread_key_create
(
&
req_key
,
NULL
));
AZ
(
pthread_key_create
(
&
name_key
,
NULL
));
AZ
(
pthread_key_create
(
&
name_key
,
NULL
));
...
...
bin/varnishd/cache/cache_panic.c
View file @
1c82be0c
...
@@ -224,7 +224,7 @@ pan_busyobj(const struct busyobj *bo)
...
@@ -224,7 +224,7 @@ pan_busyobj(const struct busyobj *bo)
pan_http
(
"bereq"
,
bo
->
bereq
,
4
);
pan_http
(
"bereq"
,
bo
->
bereq
,
4
);
if
(
bo
->
beresp
->
ws
!=
NULL
)
if
(
bo
->
beresp
->
ws
!=
NULL
)
pan_http
(
"beresp"
,
bo
->
beresp
,
4
);
pan_http
(
"beresp"
,
bo
->
beresp
,
4
);
VSB_printf
(
pan_vsp
,
" }
\n
"
);
}
}
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
...
@@ -272,7 +272,7 @@ pan_req(const struct req *req)
...
@@ -272,7 +272,7 @@ pan_req(const struct req *req)
pan_ws
(
req
->
ws
,
2
);
pan_ws
(
req
->
ws
,
2
);
pan_http
(
"req"
,
req
->
http
,
2
);
pan_http
(
"req"
,
req
->
http
,
2
);
if
(
req
->
resp
->
ws
!=
NULL
)
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
))
if
(
VALID_OBJ
(
req
->
vcl
,
VCL_CONF_MAGIC
))
pan_vcl
(
req
->
vcl
);
pan_vcl
(
req
->
vcl
);
...
@@ -293,7 +293,7 @@ pan_sess(const struct sess *sp)
...
@@ -293,7 +293,7 @@ pan_sess(const struct sess *sp)
{
{
const
char
*
stp
;
const
char
*
stp
;
VSB_printf
(
pan_vsp
,
"sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
"
sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
" fd = %d, id = %u,
\n
"
,
VSB_printf
(
pan_vsp
,
" fd = %d, id = %u,
\n
"
,
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
);
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
);
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
...
@@ -310,7 +310,7 @@ pan_sess(const struct sess *sp)
...
@@ -310,7 +310,7 @@ pan_sess(const struct sess *sp)
else
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)
...
@@ -134,6 +134,7 @@ ses_pool_task(struct worker *wrk, void *arg)
sp
=
req
->
sp
;
sp
=
req
->
sp
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
THR_SetRequest
(
req
);
AZ
(
wrk
->
aws
->
r
);
AZ
(
wrk
->
aws
->
r
);
wrk
->
lastused
=
NAN
;
wrk
->
lastused
=
NAN
;
CNT_Session
(
wrk
,
req
);
CNT_Session
(
wrk
,
req
);
...
@@ -143,6 +144,7 @@ ses_pool_task(struct worker *wrk, void *arg)
...
@@ -143,6 +144,7 @@ ses_pool_task(struct worker *wrk, void *arg)
if
(
wrk
->
vcl
!=
NULL
)
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
VCL_Rel
(
&
wrk
->
vcl
);
}
}
THR_SetRequest
(
NULL
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
@@ -315,7 +317,6 @@ ses_GetReq(struct sess *sp)
...
@@ -315,7 +317,6 @@ ses_GetReq(struct sess *sp)
AN
(
req
);
AN
(
req
);
req
->
magic
=
REQ_MAGIC
;
req
->
magic
=
REQ_MAGIC
;
req
->
sp
=
sp
;
req
->
sp
=
sp
;
THR_SetRequest
(
req
);
e
=
(
char
*
)
req
+
sz
;
e
=
(
char
*
)
req
+
sz
;
p
=
(
char
*
)(
req
+
1
);
p
=
(
char
*
)(
req
+
1
);
...
@@ -374,7 +375,6 @@ SES_ReleaseReq(struct req *req)
...
@@ -374,7 +375,6 @@ SES_ReleaseReq(struct req *req)
VSL_Flush
(
req
->
vsl
,
0
);
VSL_Flush
(
req
->
vsl
,
0
);
req
->
sp
=
NULL
;
req
->
sp
=
NULL
;
MPL_Free
(
pp
->
mpl_req
,
req
);
MPL_Free
(
pp
->
mpl_req
,
req
);
THR_SetRequest
(
NULL
);
}
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
...
...
bin/varnishtest/tests/v00010.vtc
View file @
1c82be0c
...
@@ -4,7 +4,15 @@ server s1 {
...
@@ -4,7 +4,15 @@ server s1 {
rxreq
rxreq
txresp -hdr "Foo: bar" -body "abcdef\n"
txresp -hdr "Foo: bar" -body "abcdef\n"
rxreq
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
close
sema r1 sync 2
sema r1 sync 2
...
@@ -17,8 +25,13 @@ varnish v1 -storage "-smalloc,1m" -vcl+backend {
...
@@ -17,8 +25,13 @@ varnish v1 -storage "-smalloc,1m" -vcl+backend {
import debug from "${topbuild}/lib/libvmod_debug/.libs/libvmod_debug.so";
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 {
sub vcl_deliver {
if (resp.http.panic) {
if (resp.http.panic
== "deliver"
) {
debug.panic("Had Panic header: " + resp.http.panic);
debug.panic("Had Panic header: " + resp.http.panic);
}
}
}
}
...
@@ -46,6 +59,23 @@ sema r1 sync 2
...
@@ -46,6 +59,23 @@ sema r1 sync 2
delay 0.5
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 {
client c1 {
txreq -url "/"
txreq -url "/"
rxresp
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