mirror of https://github.com/zulip/zulip.git
restart-server: Treat as a start if nothing is running.
Treating the restart as a start is important in reducing the critical period during upgrades -- we call restart even when we suspect the services are stopped, because puppet has a small possibility of placing them in indeterminate state. However, restart orders the workers first, then tornado/django, which prolongs the outage. Recognize when no services are currently started, and switch to acting like a start, not a restart, which places tornado/django first.
This commit is contained in:
parent
3717c329b8
commit
3928606886
|
@ -98,6 +98,19 @@ aux_services = list_supervisor_processes(["go-camo", "smokescreen"], only_runnin
|
|||
if aux_services:
|
||||
subprocess.check_call(["supervisorctl", "start", *aux_services])
|
||||
|
||||
# If none of the workers nor the application servers are running, this
|
||||
# is actually a "start," not a restart, which means we will defer
|
||||
# workers to later.
|
||||
if (
|
||||
action == "restart"
|
||||
and len(
|
||||
list_supervisor_processes(workers + ["zulip-django", "zulip-tornado:*"], only_running=True)
|
||||
)
|
||||
== 0
|
||||
):
|
||||
action = "start"
|
||||
verbing = "Starting"
|
||||
|
||||
|
||||
def restart_or_start(service: str) -> None:
|
||||
our_verb = action
|
||||
|
|
Loading…
Reference in New Issue