service.shutdown

The Synapse service.shutdown tool can be used to initiate a graceful shutdown of a Synapse service.

Syntax

service.shutdown is executed using python -m synapse.tools.service.shutdown. The command usage is as follows:

python -m synapse.tools.service.shutdown -h

usage: synapse.tools.service.shutdown [-h] [--url URL] [--timeout TIMEOUT]

Initiate a graceful shutdown of a service.

This tool is designed to put the service into a state where
any non-background tasks will be allowed to complete while ensuring
no new tasks are created. Without a timeout, it can block forever if
tasks do not exit.

The command exits with code 0 if the graceful shutdown was successful and
exit code 1 if a timeout was specified and was hit. Upon hitting the timeout
the system resumes normal operation.

NOTE: This will also demote the service if run on a leader with mirrors.

options:
  -h, --help         show this help message and exit
  --url URL          The telepath URL to connect to the service.
  --timeout TIMEOUT  An optional timeout in seconds. If timeout is reached,
                     the shutdown is aborted.

Note

This tool was previously run using synapse.tools.shutdown. It can still be run with that name.