Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
617a5766
Commit
617a5766
authored
Apr 02, 2021
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace master with main
parent
f1d67335
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
25 deletions
+25
-25
doc/sources/index.rst
doc/sources/index.rst
+1
-1
doc/sources/nghttpx-howto.rst
doc/sources/nghttpx-howto.rst
+2
-2
src/shrpx.cc
src/shrpx.cc
+13
-13
src/shrpx_log.cc
src/shrpx_log.cc
+1
-1
src/shrpx_signal.cc
src/shrpx_signal.cc
+5
-5
src/shrpx_signal.h
src/shrpx_signal.h
+2
-2
src/shrpx_worker_process.h
src/shrpx_worker_process.h
+1
-1
No files found.
doc/sources/index.rst
View file @
617a5766
.. nghttp2 documentation ma
ster
file, created by
.. nghttp2 documentation ma
in
file, created by
sphinx-quickstart on Sun Mar 11 22:57:49 2012.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
...
...
doc/sources/nghttpx-howto.rst
View file @
617a5766
...
...
@@ -228,7 +228,7 @@ process. It will do fork and execute new executable, using same
command-line arguments and environment variables.
As of nghttpx version 1.20.0, that is all you have to do. The new
ma
ster
process sends QUIT signal to the original process, when it is
ma
in
process sends QUIT signal to the original process, when it is
ready to serve requests, to shut it down gracefully.
For earlier versions of nghttpx, you have to do one more thing. At
...
...
@@ -239,7 +239,7 @@ current process will exit. At this point, only new nghttpx process
exists and serves incoming requests.
If you want to just reload configuration file without executing new
binary, send SIGHUP to nghttpx ma
ster
process.
binary, send SIGHUP to nghttpx ma
in
process.
Re-opening log files
--------------------
...
...
src/shrpx.cc
View file @
617a5766
...
...
@@ -124,10 +124,10 @@ constexpr auto ENV_UNIX_PATH = StringRef::from_lit("NGHTTP2_UNIX_PATH");
// descriptor. <PATH> is a path to UNIX domain socket.
constexpr
auto
ENV_ACCEPT_PREFIX
=
StringRef
::
from_lit
(
"NGHTTPX_ACCEPT_"
);
// This environment variable contains PID of the original ma
ster
// process, assuming that it created this ma
ster process as a result
//
of SIGUSR2. The new master process is expected to send QUIT signal
// t
o the original master
process to shut it down gracefully.
// This environment variable contains PID of the original ma
in
// process, assuming that it created this ma
in process as a result of
//
SIGUSR2. The new main process is expected to send QUIT signal to
// t
he original main
process to shut it down gracefully.
constexpr
auto
ENV_ORIG_PID
=
StringRef
::
from_lit
(
"NGHTTPX_ORIG_PID"
);
#ifndef _KERNEL_FASTOPEN
...
...
@@ -419,7 +419,7 @@ void exec_binary() {
// child process
shrpx_signal_unset_ma
ster
_proc_ign_handler
();
shrpx_signal_unset_ma
in
_proc_ign_handler
();
rv
=
shrpx_signal_unblock_all
();
if
(
rv
!=
0
)
{
...
...
@@ -548,7 +548,7 @@ void ipc_send(WorkerProcess *wp, uint8_t ipc_event) {
namespace
{
void
reopen_log
(
WorkerProcess
*
wp
)
{
LOG
(
NOTICE
)
<<
"Reopening log files: ma
ster
process"
;
LOG
(
NOTICE
)
<<
"Reopening log files: ma
in
process"
;
auto
config
=
get_config
();
auto
&
loggingconf
=
config
->
logging
;
...
...
@@ -1092,7 +1092,7 @@ void close_unused_inherited_addr(const std::vector<InheritedAddr> &iaddrs) {
}
// namespace
namespace
{
// Returns the PID of the original ma
ster
process from environment
// Returns the PID of the original ma
in
process from environment
// variable ENV_ORIG_PID.
pid_t
get_orig_pid_from_env
()
{
auto
s
=
getenv
(
ENV_ORIG_PID
.
c_str
());
...
...
@@ -1310,7 +1310,7 @@ namespace {
int
event_loop
()
{
std
::
array
<
char
,
STRERROR_BUFSIZE
>
errbuf
;
shrpx_signal_set_ma
ster
_proc_ign_handler
();
shrpx_signal_set_ma
in
_proc_ign_handler
();
auto
config
=
mod_config
();
...
...
@@ -1369,7 +1369,7 @@ int event_loop() {
shrpx_sd_notifyf
(
0
,
"READY=1"
);
if
(
orig_pid
!=
-
1
)
{
LOG
(
NOTICE
)
<<
"Send QUIT signal to the original ma
ster
process to tell "
LOG
(
NOTICE
)
<<
"Send QUIT signal to the original ma
in
process to tell "
"that we are ready to serve requests."
;
kill
(
orig_pid
,
SIGQUIT
);
}
...
...
@@ -2833,10 +2833,10 @@ Process:
--single-process
Run this program in a single process mode for debugging
purpose. Without this option, nghttpx creates at least
2
processes: master and worker processes. If this
option is used, master and worker are unified into a
single process. nghttpx still spawns additional process
if neverbleed is used. In the single process
mode, the
2
processes: main and worker processes. If this option
is used, main and worker are unified into a single
process. nghttpx still spawns additional process if
neverbleed is used. In the single process
mode, the
signal handling feature is disabled.
Scripting:
...
...
src/shrpx_log.cc
View file @
617a5766
...
...
@@ -189,7 +189,7 @@ Log::~Log() {
lgconf
->
update_tstamp_millis
(
std
::
chrono
::
system_clock
::
now
());
// Error log format: <datetime> <ma
ster
-pid> <current-pid>
// Error log format: <datetime> <ma
in
-pid> <current-pid>
// <thread-id> <level> (<filename>:<line>) <msg>
rv
=
snprintf
(
buf
,
sizeof
(
buf
),
"%s %d %d %s %s%s%s (%s:%d) %.*s
\n
"
,
lgconf
->
tstamp
->
time_iso8601
.
c_str
(),
config
->
pid
,
lgconf
->
pid
,
...
...
src/shrpx_signal.cc
View file @
617a5766
...
...
@@ -110,7 +110,7 @@ int signal_set_handler(void (*handler)(int), Signals &&sigs) {
}
// namespace
namespace
{
constexpr
auto
ma
ster
_proc_ign_signals
=
std
::
array
<
int
,
1
>
{
SIGPIPE
};
constexpr
auto
ma
in
_proc_ign_signals
=
std
::
array
<
int
,
1
>
{
SIGPIPE
};
}
// namespace
namespace
{
...
...
@@ -119,12 +119,12 @@ constexpr auto worker_proc_ign_signals =
GRACEFUL_SHUTDOWN_SIGNAL
,
RELOAD_SIGNAL
,
SIGPIPE
};
}
// namespace
int
shrpx_signal_set_ma
ster
_proc_ign_handler
()
{
return
signal_set_handler
(
SIG_IGN
,
ma
ster
_proc_ign_signals
);
int
shrpx_signal_set_ma
in
_proc_ign_handler
()
{
return
signal_set_handler
(
SIG_IGN
,
ma
in
_proc_ign_signals
);
}
int
shrpx_signal_unset_ma
ster
_proc_ign_handler
()
{
return
signal_set_handler
(
SIG_DFL
,
ma
ster
_proc_ign_signals
);
int
shrpx_signal_unset_ma
in
_proc_ign_handler
()
{
return
signal_set_handler
(
SIG_DFL
,
ma
in
_proc_ign_signals
);
}
int
shrpx_signal_set_worker_proc_ign_handler
()
{
...
...
src/shrpx_signal.h
View file @
617a5766
...
...
@@ -49,8 +49,8 @@ int shrpx_signal_unblock_all();
// -1. The errno will indicate the error.
int
shrpx_signal_set
(
sigset_t
*
set
);
int
shrpx_signal_set_ma
ster
_proc_ign_handler
();
int
shrpx_signal_unset_ma
ster
_proc_ign_handler
();
int
shrpx_signal_set_ma
in
_proc_ign_handler
();
int
shrpx_signal_unset_ma
in
_proc_ign_handler
();
int
shrpx_signal_set_worker_proc_ign_handler
();
int
shrpx_signal_unset_worker_proc_ign_handler
();
...
...
src/shrpx_worker_process.h
View file @
617a5766
...
...
@@ -32,7 +32,7 @@ namespace shrpx {
class
ConnectionHandler
;
struct
WorkerProcessConfig
{
// IPC socket to read event from ma
ster
process
// IPC socket to read event from ma
in
process
int
ipc_fd
;
// IPv4 or UNIX domain socket, or -1 if not used
int
server_fd
;
...
...
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