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
9fe43bdf
Commit
9fe43bdf
authored
Oct 07, 2019
by
Andrew Wiik
Committed by
Reza Naghibi
Oct 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a 'debug.reqpool.fail F__F____F_FFF' command
0ad32622
Co-authored-by:
Poul-Henning Kamp
<
phk@FreeBSD.org
>
parent
e9523422
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
0 deletions
+65
-0
cache_main.c
bin/varnishd/cache/cache_main.c
+2
-0
cache_varnishd.h
bin/varnishd/cache/cache_varnishd.h
+3
-0
cache_wrk.c
bin/varnishd/cache/cache_wrk.c
+50
-0
cli_cmds.h
include/tbl/cli_cmds.h
+10
-0
No files found.
bin/varnishd/cache/cache_main.c
View file @
9fe43bdf
...
...
@@ -391,6 +391,8 @@ child_main(int sigmagic, size_t altstksz)
VMOD_Init
();
WRK_Init
();
BAN_Compile
();
VRND_SeedAll
();
...
...
bin/varnishd/cache/cache_varnishd.h
View file @
9fe43bdf
...
...
@@ -414,6 +414,9 @@ extern struct vrt_privs cli_task_privs[1];
void
VMOD_Init
(
void
);
void
VMOD_Panic
(
struct
vsb
*
);
/* cache_wrk.c */
void
WRK_Init
(
void
);
/* http1/cache_http1_pipe.c */
void
V1P_Init
(
void
);
...
...
bin/varnishd/cache/cache_wrk.c
View file @
9fe43bdf
...
...
@@ -58,12 +58,15 @@
#include "cache_varnishd.h"
#include "cache_pool.h"
#include "vcli_serve.h"
#include "vtim.h"
#include "hash/hash_slinger.h"
static
void
Pool_Work_Thread
(
struct
pool
*
pp
,
struct
worker
*
wrk
);
static
uintmax_t
reqpoolfail
;
/*--------------------------------------------------------------------
* Create and start a back-ground thread which as its own worker and
* session data structures;
...
...
@@ -261,6 +264,17 @@ Pool_Task(struct pool *pp, struct pool_task *task, enum task_prio prio)
AN
(
task
->
func
);
assert
(
prio
<
TASK_QUEUE_END
);
if
(
prio
==
TASK_QUEUE_REQ
&&
reqpoolfail
)
{
retval
=
reqpoolfail
&
1
;
reqpoolfail
>>=
1
;
if
(
retval
)
{
VSL
(
SLT_Debug
,
0
,
"Failing due to reqpoolfail (next= 0x%jx)"
,
reqpoolfail
);
return
(
retval
);
}
}
Lck_Lock
(
&
pp
->
mtx
);
/* The common case first: Take an idle thread, do it. */
...
...
@@ -610,3 +624,39 @@ pool_herder(void *priv)
}
return
(
NULL
);
}
/*--------------------------------------------------------------------
* Debugging aids
*/
static
void
v_matchproto_
(
cli_func_t
)
debug_reqpoolfail
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
uintmax_t
u
=
1
;
const
char
*
p
;
(
void
)
priv
;
(
void
)
cli
;
reqpoolfail
=
0
;
for
(
p
=
av
[
2
];
*
p
!=
'\0'
;
p
++
)
{
if
(
*
p
==
'F'
||
*
p
==
'f'
)
reqpoolfail
|=
u
;
u
<<=
1
;
}
}
static
struct
cli_proto
debug_cmds
[]
=
{
{
CLICMD_DEBUG_REQPOOLFAIL
,
"d"
,
debug_reqpoolfail
},
{
NULL
}
};
/*--------------------------------------------------------------------
*
*/
void
WRK_Init
(
void
)
{
CLI_AddFuncs
(
debug_cmds
);
}
include/tbl/cli_cmds.h
View file @
9fe43bdf
...
...
@@ -278,6 +278,16 @@ CLI_CMD(DEBUG_FRAGFETCH,
1
,
1
)
CLI_CMD
(
DEBUG_REQPOOLFAIL
,
"debug.reqpool.fail"
,
"debug.reqpool.fail"
,
"Schedule req-pool failures."
,
"The argument is read L-R and 'f' means fail:
\n\n
"
"
\t
param.set debug.reqpoolfail F__F
\n\n
"
"Means that the frist and the third attempted allocation will fail"
,
1
,
1
)
CLI_CMD
(
DEBUG_XID
,
"debug.xid"
,
"debug.xid"
,
...
...
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