From 2587fa1570e793c04167fbc738ff5fca4570c9ea Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Fri, 3 Sep 2021 21:59:12 -0300 Subject: [PATCH] gitlab-ci: Add sleep for every `scheduler.jobs.logs` call Add a time.sleep call between proxy.scheduler.jobs.logs calls, since they do not block. This will relieve some request pressure on LAVA dispatchers. Signed-off-by: Guilherme Gallo Reviewed-by: Tomeu Vizoso Part-of: --- .gitlab-ci/lava/lava_job_submitter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py index 60c4fac62bb..af20abdbc64 100755 --- a/.gitlab-ci/lava/lava_job_submitter.py +++ b/.gitlab-ci/lava/lava_job_submitter.py @@ -223,6 +223,11 @@ def follow_job_execution(proxy, job_id): line_count += len(logs) + # `proxy.scheduler.jobs.logs` does not block, even when there is no + # new log to be fetched. To avoid dosing the LAVA dispatcher + # machine, let's add a sleep to save them some stamina. + time.sleep(5) + def show_job_data(proxy, job_id): show = _call_proxy(proxy.scheduler.jobs.show, job_id)