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
1d327ef3
Unverified
Commit
1d327ef3
authored
Nov 13, 2018
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make VSM_Attach interruptible
Fixes #2657.
parent
a50d90d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
varnishadm.c
bin/varnishadm/varnishadm.c
+4
-0
u00003.vtc
bin/varnishtest/tests/u00003.vtc
+5
-0
vsm.c
lib/libvarnishapi/vsm.c
+3
-1
No files found.
bin/varnishadm/varnishadm.c
View file @
1d327ef3
...
...
@@ -59,6 +59,7 @@
#include "vdef.h"
#include "vapi/vsig.h"
#include "vapi/vsm.h"
#include "vas.h"
#include "vcli.h"
...
...
@@ -472,6 +473,9 @@ main(int argc, char * const *argv)
argc
-=
optind
;
argv
+=
optind
;
VSIG_Arm_int
();
VSIG_Arm_term
();
if
(
T_arg
!=
NULL
)
{
if
(
n_arg
!=
NULL
)
usage
(
1
);
...
...
bin/varnishtest/tests/u00003.vtc
View file @
1d327ef3
...
...
@@ -154,3 +154,8 @@ process p1 -expect-text 1 0 {/1?foo=bar HTTP/1.1" 200 100 "-" "-"}
process p1 -expect-text 1 0 { - user [}
process p1 -expect-text 2 0 {/1?foo=bar HTTP/1.1" 404 248 "-" "-"}
process p1 -expect-text 3 0 {/2 HTTP/1.1" - - "-" "-"}
process p2 {varnishncsa -t 5 -n nonexistent} -start
delay 1
process p2 -expect-exit 1 -kill INT -wait
shell {grep -q "VSM: Attach interrupted" ${p2_err}}
lib/libvarnishapi/vsm.c
View file @
1d327ef3
...
...
@@ -55,6 +55,7 @@
#include "vqueue.h"
#include "vtim.h"
#include "vapi/vsig.h"
#include "vapi/vsm.h"
#ifndef MAP_HASSEMAPHORE
...
...
@@ -676,7 +677,7 @@ VSM_Attach(struct vsm *vd, int progress)
}
AZ
(
vd
->
attached
);
while
(
1
)
{
while
(
!
VSIG_int
&&
!
VSIG_term
)
{
u
=
VSM_Status
(
vd
);
VSM_ResetError
(
vd
);
if
(
u
&
VSM_MGT_RUNNING
)
{
...
...
@@ -695,6 +696,7 @@ VSM_Attach(struct vsm *vd, int progress)
(
void
)
write
(
progress
,
"."
,
1
);
VTIM_sleep
(.
25
);
}
return
(
vsm_diag
(
vd
,
"Attach interrupted"
));
}
/*--------------------------------------------------------------------*/
...
...
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