tornado: Perform rolling client restarts after servers are restarted.

Decouple the sending of client restart events from the restarting of
the servers.  Restarts use the new Tornado restart-clients endpoint to
inject "restart" events into queues of clients which were loaded from
the previous Tornado process.  The rate is controlled by the
`application_server.client_restart_rate`, in clients per minute, or a
flag to `restart-clients` which overrides it.  Note that a web client
will also spread its restart over 5 minutes, so artificially-slow
client restarts are generally not very necessary.

Restarts of clients are deferred to until after post-deploy hooks are
run, such that the pre- and post- deploy hooks are around the actual
server restarts, even if pushing restart events to clients takes
significant time.
This commit is contained in:
Alex Vandiver
2024-02-08 21:04:07 +00:00
committed by Tim Abbott
parent 27d53ecbe1
commit ec6f64f7b0
5 changed files with 91 additions and 3 deletions

View File

@@ -682,6 +682,11 @@ def start_arg_parser(action: str, add_help: bool = False) -> argparse.ArgumentPa
parser.add_argument(
"--skip-checks", action="store_true", help="Skip syntax and database checks"
)
parser.add_argument(
"--skip-client-reloads",
action="store_true",
help="Do not send reload events to web clients",
)
if action == "restart":
parser.add_argument(
"--less-graceful",