summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniele Sassoli <danielesassoli@gmail.com>2024-01-12 15:30:34 -0800
committerDaniele Sassoli <danielesassoli@gmail.com>2024-01-12 16:10:42 -0800
commit92b74a5064fd892f5e492a80de9397b61a5a92d2 (patch)
tree76ad8c44876b50f4e7217b6c5fd4ee7c480b0253
parente487dbe9e60dcda2b4b61a4762189cb7c483c927 (diff)
Make extra stop timeout configurable
Currently we only wait 30 seconds on top of either httpd or sshd gracefulStopTimeout before terminating Gerrit, in some instances this might not be enough. Make it configurable so end user can decide what's best for their use case. Release-Notes: Introduce configurable shutdown timeout Change-Id: Ie976264792f683f8024f0b0266a3318f509f5cf5
-rw-r--r--Documentation/config-gerrit.txt7
-rwxr-xr-xresources/com/google/gerrit/pgm/init/gerrit.sh2
2 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/config-gerrit.txt b/Documentation/config-gerrit.txt
index 9e36313d97..d942aa3273 100644
--- a/Documentation/config-gerrit.txt
+++ b/Documentation/config-gerrit.txt
@@ -1889,6 +1889,13 @@ The maximum time (in seconds) to wait for a gerrit.sh start command
to run a new Gerrit daemon successfully. If not set, defaults to
90 seconds.
+[[container.shutdownTimeout]]container.shutdownTimeout::
++
+The maximum time (in seconds) to wait for a gerrit.sh stop command.
+This is added to the highest value between either 'sshd.gracefulStopTimeout'
+or 'httpd.gracefulStopTimeout'. If not set, defaults to
+30 seconds
+
[[container.user]]container.user::
+
Login name (or UID) of the operating system user the Gerrit JVM
diff --git a/resources/com/google/gerrit/pgm/init/gerrit.sh b/resources/com/google/gerrit/pgm/init/gerrit.sh
index e7fda5a6f8..257dc61d7c 100755
--- a/resources/com/google/gerrit/pgm/init/gerrit.sh
+++ b/resources/com/google/gerrit/pgm/init/gerrit.sh
@@ -353,7 +353,7 @@ ulimit -x >/dev/null 2>&1 && ulimit -x unlimited ; # file locks
#####################################################
# Configure the maximum wait time for shutdown
#####################################################
-EXTRA_STOP_TIMEOUT=30
+EXTRA_STOP_TIMEOUT=$(get_time_unit_sec "$(get_config --get container.shutdownTimeout || echo 30)")
HTTPD_STOP_TIMEOUT=$(get_time_unit_sec "$(get_config --get httpd.gracefulStopTimeout || echo 0)")
SSHD_STOP_TIMEOUT=$(get_time_unit_sec "$(get_config --get sshd.gracefulStopTimeout || echo 0)")