From f8f34e0c471c37c4f9e39135bbcf6501f00440aa Mon Sep 17 00:00:00 2001 From: "Dr. Jens Harbott" Date: Fri, 3 Dec 2021 19:28:29 +0100 Subject: [PATCH] Bump timeout for grafana startup The initial migrations when starting grafana for the first time may sometimes take much longer than 20s, we have seen samples up to near 60s. Allow 120s to have some margin. Also make the timeout parameters configurable. Closes-Bug: 1769962 Signed-off-by: Dr. Jens Harbott Change-Id: If9186d8aa65150c492657550064789e211dbb570 --- ansible/roles/grafana/defaults/main.yml | 3 +++ ansible/roles/grafana/handlers/main.yml | 4 ++-- ...fana-start-first-node-timeout-f9a6149cc68153a5.yaml | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/grafana-start-first-node-timeout-f9a6149cc68153a5.yaml diff --git a/ansible/roles/grafana/defaults/main.yml b/ansible/roles/grafana/defaults/main.yml index 05593064bb..0fba0e43e2 100644 --- a/ansible/roles/grafana/defaults/main.yml +++ b/ansible/roles/grafana/defaults/main.yml @@ -81,6 +81,9 @@ grafana_default_volumes: - "kolla_logs:/var/log/kolla/" grafana_extra_volumes: "{{ default_extra_volumes }}" +grafana_start_first_node_delay: 10 +grafana_start_first_node_retries: 12 + ############ # Prometheus ############ diff --git a/ansible/roles/grafana/handlers/main.yml b/ansible/roles/grafana/handlers/main.yml index 2e13a056a3..30042ef684 100644 --- a/ansible/roles/grafana/handlers/main.yml +++ b/ansible/roles/grafana/handlers/main.yml @@ -29,8 +29,8 @@ status_code: 200 register: result until: result.get('status') == 200 - retries: 10 - delay: 2 + retries: "{{ grafana_start_first_node_retries }}" + delay: "{{ grafana_start_first_node_delay }}" when: - kolla_action != "config" - inventory_hostname == groups[service.group]|first diff --git a/releasenotes/notes/grafana-start-first-node-timeout-f9a6149cc68153a5.yaml b/releasenotes/notes/grafana-start-first-node-timeout-f9a6149cc68153a5.yaml new file mode 100644 index 0000000000..d381661882 --- /dev/null +++ b/releasenotes/notes/grafana-start-first-node-timeout-f9a6149cc68153a5.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - | + On slower nodes, the initial grafana startup could experience a + timeout failure when the migrations for setting up the database + took longer than expected. This has been fixed by increasing the + default timeout. The timeout settings can be changed via new + parameters ``grafana_start_first_node_delay`` and + ``grafana_start_first_node_retries`` for the ``grafana`` role. + `LP#1769962 `__