]> git.evergreen-ils.org Git - OpenSRF.git/commit
LP#1803182 Websocketd graceful shutdown support
authorBill Erickson <berickxx@gmail.com>
Tue, 13 Nov 2018 22:21:18 +0000 (17:21 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 17 Dec 2018 21:13:19 +0000 (16:13 -0500)
commitf3eab1715079243d541dc12fd90db005630ffec9
treefe913fe185a6e590fbba23220b4e668388cbeeb1
parent304365165e7ba0cc08bb6c5f0ba25f0b541fd27d
LP#1803182 Websocketd graceful shutdown support

Give websocketd clients a chance to complete any requests that are
in-process at time of shutdown.

Graceful shutdown is initiated by sending a SIGUSR1 signal to the
websocket-osrf child processes or to the parent process group.

This can be done directly via:

$ kill -s USR1 -$websocketd_parent_pid

Or via systemd for systemd users:

$ sudo systemctl kill -s USR1 websocketd-osrf

Note the websocketd parent process ignores SIGUSR1.

Once initiated, the websocketd backend goes into shutdown mode polling
for a graceful shutdown window, which occurs when all request up to now
have been completed.  Once that moment arrives, the client is kicked off
and must connect to a new websocketd instance to issue any new requests.

The polling period lasts for SHUTDOWN_MAX_GRACEFUL_SECONDS seconds (in
osrf-websocket-stdio.c), which currently defaults to 2 minutes.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
src/websocket-stdio/osrf-websocket-stdio.c