]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
tasks/cbt_performance: Tolerate exceptions during performance data updates
authorNitzan Mordechai <nmordech@redhat.com>
Wed, 22 Oct 2025 05:41:56 +0000 (05:41 +0000)
committerShraddha Agrawal <shraddha.agrawal000@gmail.com>
Thu, 20 Nov 2025 12:15:36 +0000 (17:45 +0530)
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 <nmordech@ibm.com>
(cherry picked from commit b47880f82de436776acab7ff13fb5e6496e49170)

qa/tasks/cbt_performance.py

index 44f6d9ade3df41827e29cd01cec6e2953e8062d2..9a52b84bf1d42a4b70d0f2dd434328cc11b2cc05 100644 (file)
@@ -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):