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 <nmordech@ibm.com>
This commit is contained in:
Nitzan Mordechai 2025-10-22 05:41:56 +00:00
parent 3aef9fc059
commit b47880f82d

View 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):