From f4683de7427607cbb87ebfe2cd68cc9eb3baa612 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 20 Jan 2022 04:16:52 +0000 Subject: [PATCH] puppet: Switch the `rolling_restart` setting to use the bool values. 2c5fc1827cb4 standardized which values are "true"; use them. --- docs/production/deployment.md | 8 ++++---- puppet/zulip/manifests/app_frontend_base.pp | 2 +- puppet/zulip/templates/uwsgi.ini.template.erb | 2 +- scripts/restart-server | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/production/deployment.md b/docs/production/deployment.md index 60bc26218b..4c3adede51 100644 --- a/docs/production/deployment.md +++ b/docs/production/deployment.md @@ -754,10 +754,10 @@ RabbitMQ. #### `rolling_restart` -If set to a non-empty value, when using `./scripts/restart-server` to -restart Zulip, restart the uwsgi processes one-at-a-time, instead of -all at once. This decreases the number of 502's served to clients, at -the cost of slightly increased memory usage, and the possibility that +If set to true, when using `./scripts/restart-server` to restart +Zulip, restart the uwsgi processes one-at-a-time, instead of all at +once. This decreases the number of 502's served to clients, at the +cost of slightly increased memory usage, and the possibility that different requests will be served by different versions of the code. #### `s3_memory_cache_size` diff --git a/puppet/zulip/manifests/app_frontend_base.pp b/puppet/zulip/manifests/app_frontend_base.pp index dc5a0b13f1..05e2a2854a 100644 --- a/puppet/zulip/manifests/app_frontend_base.pp +++ b/puppet/zulip/manifests/app_frontend_base.pp @@ -152,7 +152,7 @@ class zulip::app_frontend_base { notify => Service[$zulip::common::supervisor_service], } - $uwsgi_rolling_restart = zulipconf('application_server', 'rolling_restart', '') + $uwsgi_rolling_restart = zulipconf('application_server', 'rolling_restart', false) $uwsgi_listen_backlog_limit = zulipconf('application_server', 'uwsgi_listen_backlog_limit', 128) $uwsgi_processes = zulipconf('application_server', 'uwsgi_processes', $uwsgi_default_processes) $somaxconn = 2 * Integer($uwsgi_listen_backlog_limit) diff --git a/puppet/zulip/templates/uwsgi.ini.template.erb b/puppet/zulip/templates/uwsgi.ini.template.erb index c5a77e2431..c6e2b4cc79 100644 --- a/puppet/zulip/templates/uwsgi.ini.template.erb +++ b/puppet/zulip/templates/uwsgi.ini.template.erb @@ -53,7 +53,7 @@ post-buffering=4096 stats=/home/zulip/deployments/uwsgi-stats -<% if @uwsgi_rolling_restart != '' -%> +<% if @uwsgi_rolling_restart -%> # If we are doing a rolling restart, re-chdir to the current "current" # directory in each forked process hook-post-fork=chdir:/home/zulip/deployments/current diff --git a/scripts/restart-server b/scripts/restart-server index e10f49d1b2..45a9e08f6e 100755 --- a/scripts/restart-server +++ b/scripts/restart-server @@ -14,7 +14,7 @@ from scripts.lib.zulip_tools import ( ENDC, OKGREEN, WARNING, - get_config, + get_config_bool, get_config_file, get_tornado_ports, has_application_server, @@ -178,7 +178,7 @@ if has_application_server(): if ( action == "restart" and not args.less_graceful - and get_config(config_file, "application_server", "rolling_restart") != "" + and get_config_bool(config_file, "application_server", "rolling_restart") and os.path.exists("/home/zulip/deployments/uwsgi-control") ): # See if it's currently running