Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/appendices/command-line/traffic_manager.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ Signals
SIGHUP
This signal causes a reconfiguration event, equivalent to running :program:`traffic_ctl config reload`.

SIGINT, SIGTERM
These signals cause :program:`traffic_manager` to exit after also shutting down :program:`traffic_server`.

See also
========

:manpage:`traffic_ctl(8)`
:manpage:`traffic_ctl(8)`,
:manpage:`traffic_server(8)`
9 changes: 6 additions & 3 deletions doc/appendices/command-line/traffic_server.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,14 @@ startup. This is primarily useful for testing.
Signals
=======

On `SIGTERM`, :program:`traffic_server` exits.
SIGINT, SIGTERM
On `SIGINT` and `SIGTERM`, :program:`traffic_server` exits.

On `SIGUSR1`, :program:`traffic_server` logs its current memory usage.
SIGUSR1
On `SIGUSR1`, :program:`traffic_server` logs its current memory usage.

On `SIGUSR2`, :program:`traffic_server` re-opens its standard error and standard out file descriptors.
SIGUSR2
On `SIGUSR2`, :program:`traffic_server` re-opens its standard error and standard out file descriptors.

See also
========
Expand Down
10 changes: 6 additions & 4 deletions proxy/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ class SignalContinuation : public Continuation
diags->set_stderr_output(bind_stderr);
}

if (signal_received[SIGTERM]) {
if (signal_received[SIGTERM] || signal_received[SIGINT]) {
signal_received[SIGTERM] = false;
signal_received[SIGINT] = false;

RecInt timeout = 0;
REC_ReadConfigInteger(timeout, "proxy.config.stop.shutdown_timeout");
Expand All @@ -279,7 +280,7 @@ class SignalContinuation : public Continuation
http2_drain = true;
}

Debug("server", "received SIGTERM, shutting down in %" PRId64 "secs", timeout);
Debug("server", "received exit signal, shutting down in %" PRId64 "secs", timeout);

// Shutdown in `timeout` seconds (or now if that is 0).
eventProcessor.schedule_in(new AutoStopCont(), HRTIME_SECONDS(timeout));
Expand Down Expand Up @@ -463,10 +464,11 @@ proxy_signal_handler(int signo, siginfo_t *info, void *ctx)

// These signals are all handled by SignalContinuation.
switch (signo) {
case SIGUSR1:
case SIGUSR2:
case SIGHUP:
case SIGINT:
case SIGTERM:
case SIGUSR1:
case SIGUSR2:
return;
}

Expand Down