From 270b7b1d8924706a667e652ee90bd270f05b1560 Mon Sep 17 00:00:00 2001 From: Nitzan Mordechai Date: Wed, 22 Oct 2025 05:41:56 +0000 Subject: [PATCH] tasks/cbt_performance: Tolerate exceptions during performance data updates If an exception occurs during the POST request to update CBT performance, log the error instead of failing the entire job. This ensures that intermittent update failures do not block the main workflow. Fixes: https://tracker.ceph.com/issues/68843 Signed-off-by: Nitzan Mordechai (cherry picked from commit b47880f82de436776acab7ff13fb5e6496e49170) --- qa/tasks/cbt_performance.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/qa/tasks/cbt_performance.py b/qa/tasks/cbt_performance.py index 44f6d9ade3d..9a52b84bf1d 100644 --- a/qa/tasks/cbt_performance.py +++ b/qa/tasks/cbt_performance.py @@ -50,12 +50,18 @@ class CBTperformance: "benchmark" : benchmark["benchmarks"], "results" : cbt_results.get("results", None), } - response = requests.post(self.endpoint_url, json=data, headers=self.headers, auth=self.auth) - if response.status_code == 201: - self.log.info("Data inserted successfully.") - ctx.summary['cbt_perf_url'] = self.create_cbt_perf_url(ctx, config) - else: - self.log.info(f"Error inserting data: {response}") + + try: + response = requests.post(self.endpoint_url, json=data, headers=self.headers, auth=self.auth, timeout=10) + if response.status_code == 201: + self.log.info("Data inserted successfully.") + ctx.summary['cbt_perf_url'] = self.create_cbt_perf_url(ctx, config) + else: + self.log.info(f"Error inserting data: {response}") + except requests.exceptions.RequestException as e: + self.log.warning(f"Could not send performance data to {self.endpoint_url}: {e}") + self.log.warning("Continuing without performance data collection") + return def read_results(self, ctx, config): -- 2.47.3