Make waiting time for --tags=start configurable

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/1062
This commit is contained in:
Slavi Pantaleev 2021-05-19 08:39:28 +03:00
parent 2606b41b16
commit ee46fabdca
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,16 @@
# Specifies how long to wait between starting systemd services and checking if they're started.
#
# A too low value may lead to a failure, as services may not have enough time to start and potentially fail.
#
# A value higher than 30 seconds (or any multiple of that) may also not work well, because a failing systemd service
# auto-restarts after 30 seconds (`RestartSec=30` in systemd service files).
# Checking if a service is running right after it had potentially restarted in such a way will lead us to
# thinking it's running, while it's merely starting again (and likely to fail again, given that it already did once).
#
# All of the services we manage are also started sequentially, which in itself can take a long time.
# There may be a ~10 second (or even larger) interval between starting the first service and starting the last one.
# This makes it even harder to pick a correct value. Such a 10 second gap and a waiting time of 20 seconds will
# put us right at the "dangerous" 30-second mark.
#
# We can try to measure this gap and adjust our waiting time accordingly, but we currently don't.
matrix_common_after_systemd_service_start_wait_for_timeout_seconds: 15

View File

@ -30,7 +30,7 @@
# as we may run into systemd's automatic restart logic retrying the service. # as we may run into systemd's automatic restart logic retrying the service.
- name: Wait a bit, so that services can start (or fail) - name: Wait a bit, so that services can start (or fail)
wait_for: wait_for:
timeout: 15 timeout: "{{ matrix_common_after_systemd_service_start_wait_for_timeout_seconds }}"
delegate_to: 127.0.0.1 delegate_to: 127.0.0.1
become: false become: false