Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
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
trackrdrd
Commits
2ae5802c
Commit
2ae5802c
authored
Apr 30, 2015
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a signal handler to tell VSL to flush pending transactions
parent
d3884da5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
child.c
src/child.c
+13
-1
signals.h
src/signals.h
+1
-1
No files found.
src/child.c
View file @
2ae5802c
...
...
@@ -99,7 +99,7 @@ static unsigned long seen = 0, submitted = 0, len_overflows = 0, no_data = 0,
static
volatile
sig_atomic_t
flush
=
0
,
term
=
0
;
static
struct
sigaction
terminate_action
,
dump_action
;
static
struct
sigaction
terminate_action
,
dump_action
,
flush_action
;
/* Local freelist */
static
struct
freehead_s
reader_freelist
=
...
...
@@ -140,6 +140,14 @@ term_s(int sig)
flush
=
1
;
}
static
void
sigflush
(
int
sig
)
{
flush
=
1
;
LOG_Log
(
LOG_NOTICE
,
"Received signal %d (%s), "
"flushing pending transactions"
,
sig
,
strsignal
(
sig
));
}
/*--------------------------------------------------------------------*/
/* efficiently retrieve a single data entry */
...
...
@@ -487,6 +495,10 @@ CHILD_Main(int readconfig)
AZ
(
sigemptyset
(
&
terminate_action
.
sa_mask
));
terminate_action
.
sa_flags
&=
~
SA_RESTART
;
flush_action
.
sa_handler
=
sigflush
;
AZ
(
sigemptyset
(
&
flush_action
.
sa_mask
));
flush_action
.
sa_flags
|=
SA_RESTART
;
#define CHILD(SIG,disp) SIGDISP(SIG,disp)
#define PARENT(SIG,disp) ((void) 0)
#include "signals.h"
...
...
src/signals.h
View file @
2ae5802c
...
...
@@ -44,7 +44,7 @@ CHILD(SIGTERM, terminate_action);
CHILD
(
SIGINT
,
terminate_action
);
CHILD
(
SIGUSR1
,
dump_action
);
CHILD
(
SIGUSR2
,
ignore_action
);
CHILD
(
SIGHUP
,
ignore
_action
);
CHILD
(
SIGHUP
,
flush
_action
);
#ifndef DISABLE_STACKTRACE
CHILD
(
SIGABRT
,
stacktrace_action
);
CHILD
(
SIGSEGV
,
stacktrace_action
);
...
...
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