Allow terminationGracePeriodSeconds to be configurable

Set a default of 6 hours, but allow users to tell us to wait a
longer or shorter time for executors to gracefully stop.

Change-Id: I12aada7a3c3aaff7b8bbe51744a8dd4d367b6e5a
This commit is contained in:
James E. Blair 2021-04-12 16:47:57 -07:00
parent 3df4bc0ad1
commit c531a6fb23
3 changed files with 13 additions and 1 deletions

View File

@ -404,6 +404,16 @@ verbatim):
The key name in the secret should be ``sshkey``. The key name in the secret should be ``sshkey``.
.. attr:: terminationGracePeriodSeconds
:default: 21600
When performing a rolling restart of the executors, wait
this long for jobs to finish normally. If an executor
takes longer than this amount of time, it will be
hard-stopped (and jobs will abort and retry). The default
is 6 hours, but depending on the workload, a higher or
lower value may be appropriate.
.. attr:: merger .. attr:: merger
.. attr:: count .. attr:: count

View File

@ -347,7 +347,7 @@ spec:
{%- endfor %} {%- endfor %}
securityContext: securityContext:
privileged: true privileged: true
terminationGracePeriodSeconds: 3600 terminationGracePeriodSeconds: {{ spec.executor.terminationGracePeriodSeconds }}
lifecycle: lifecycle:
preStop: preStop:
exec: exec:

View File

@ -69,6 +69,8 @@ class Zuul:
'/etc/zuul/tenant/main.yaml' '/etc/zuul/tenant/main.yaml'
self.spec.setdefault('executor', {}).setdefault('count', 1) self.spec.setdefault('executor', {}).setdefault('count', 1)
self.spec.setdefault('executor', {}).setdefault(
'terminationGracePeriodSeconds', 21600)
self.spec.setdefault('merger', {}).setdefault('count', 0) self.spec.setdefault('merger', {}).setdefault('count', 0)
self.spec.setdefault('web', {}).setdefault('count', 1) self.spec.setdefault('web', {}).setdefault('count', 1)
self.spec.setdefault('fingergw', {}).setdefault('count', 1) self.spec.setdefault('fingergw', {}).setdefault('count', 1)