Skip to content

Commit b47880f

Browse files
committed
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 <[email protected]>
1 parent 3aef9fc commit b47880f

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

qa/tasks/cbt_performance.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ def collect(self, ctx, config):
5050
"benchmark" : benchmark["benchmarks"],
5151
"results" : cbt_results.get("results", None),
5252
}
53-
response = requests.post(self.endpoint_url, json=data, headers=self.headers, auth=self.auth)
54-
if response.status_code == 201:
55-
self.log.info("Data inserted successfully.")
56-
ctx.summary['cbt_perf_url'] = self.create_cbt_perf_url(ctx, config)
57-
else:
58-
self.log.info(f"Error inserting data: {response}")
53+
54+
try:
55+
response = requests.post(self.endpoint_url, json=data, headers=self.headers, auth=self.auth, timeout=10)
56+
if response.status_code == 201:
57+
self.log.info("Data inserted successfully.")
58+
ctx.summary['cbt_perf_url'] = self.create_cbt_perf_url(ctx, config)
59+
else:
60+
self.log.info(f"Error inserting data: {response}")
61+
except requests.exceptions.RequestException as e:
62+
self.log.warning(f"Could not send performance data to {self.endpoint_url}: {e}")
63+
self.log.warning("Continuing without performance data collection")
64+
return
5965

6066

6167
def read_results(self, ctx, config):

0 commit comments

Comments
 (0)