From 1ada0853fbb3d68b66cbe293a5a3f2dae714e8b9 Mon Sep 17 00:00:00 2001 From: Omar Selo Date: Thu, 10 Oct 2024 12:37:44 +0000 Subject: [PATCH 1/2] Add timeout to fetching archive or else it hangs indefinitely --- backend/test_observer/external_apis/archive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/test_observer/external_apis/archive.py b/backend/test_observer/external_apis/archive.py index 9a4fff93..532d8f53 100644 --- a/backend/test_observer/external_apis/archive.py +++ b/backend/test_observer/external_apis/archive.py @@ -115,7 +115,7 @@ def _create_download_and_extract_filepaths(self) -> None: def _download_data(self) -> None: """Download Packages.gz file from archive""" - response = requests.get(self.url, stream=True) + response = requests.get(self.url, stream=True, timeout=30) if not response.ok: response.raise_for_status() From 38c0ab169ae04d2a86497adbb7d425aaa6674898 Mon Sep 17 00:00:00 2001 From: Omar Selo Date: Thu, 10 Oct 2024 12:43:06 +0000 Subject: [PATCH 2/2] Add timeout to fetching swm or else it hangs indefinitely --- backend/test_observer/kernel_swm_integration/swm_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/test_observer/kernel_swm_integration/swm_reader.py b/backend/test_observer/kernel_swm_integration/swm_reader.py index 9b57a268..b3e48444 100644 --- a/backend/test_observer/kernel_swm_integration/swm_reader.py +++ b/backend/test_observer/kernel_swm_integration/swm_reader.py @@ -20,7 +20,7 @@ def get_artefacts_swm_info(db: Session) -> dict[int, ArtefactTrackerInfo]: def _fetch_stable_workflow_manager_status() -> dict: url = "https://kernel.ubuntu.com/swm/status.json" - return requests.get(url).json() + return requests.get(url, timeout=30).json() def _extract_artefact_bug_info_from_swm(