Project

General

Profile

Actions

Bug #57890

open

cmd_getval() throws but many callers don't catch the exception

Added by Radoslaw Zarzynski over 1 year ago. Updated 8 months ago.

Status:
New
Priority:
High
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

In https://github.com/ceph/ceph/pull/23557 we switched cmd_getval() to throw on error. This family of functions have around 500 of users while only few were fitted with try {} catch as – possibly – even an unhandled exception can be deemed a lesser evil than a byzantine fault (due to letting a program to execute further after ignoring an error). However, recently https://tracker.ceph.com/issues/54558 popped up and ignited the discussion (see https://github.com/ceph/ceph/pull/45547#pullrequestreview-1099607585).

Could we tackle the problem by switching back to error codes while using [[nodiscard]] to hunt down all callers who ignore the errors?

Actions

Also available in: Atom PDF