mirror of
https://github.com/ceph/ceph
synced 2026-08-02 07:03:18 +00:00
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:
parent
3aef9fc059
commit
b47880f82d
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user