Repository navigation
crimson/common/errorator: disallow void-returning error handlers - #55735
Conversation
0743bc9 to
14ac6c8
Compare
bc39a66 to
54f7dc9
Compare
|
jenkins test make check |
54f7dc9 to
4390e10
Compare
|
@xxhdx1985126 I don't very understand the problem, if we return void, what happened? why there is no complier error if we can't return void? |
To invoke error handlers, the exception of the future has to be extracted out, which would invalidate the future. When the error handler returns void, the invalid future is returned, and later |
so when return no_touch_error_marker, the ::then will not be invoked, right? |
No, with void-returning handlers, the |
@xxhdx1985126 the exception future is extracted out and handled in error handler, if we return non void future such as seastar::now, what is the following logic? the ::then continue execute based on this future? |
Yes, but we have to return futures with the same type as the exception-extracted-out future, if that future is not |
|
for some critical error happened, system should be terminated, such as std::exit(), ceph_abort(), abort() are called in error handler, do we still need make them return a ready future? I think the future will not get chance to return, right? |
Or use |
assert_all also call ceph_abort(), I mean for that critical error, program should be terminated immediately otherwise there are logical error if continue, so call std::ext(), ceph_about() and needn't return any future, but for some tiny error, the system still can going on, or the error fixed in error handler, then we can return a ready future to make the program continue. so which error handle cause the void return and cause system crash, why we don't use abort() there, is it a tiny error? |
For any non-void-returning functions, not only those return futures, we always have to return a valid value, even if we need to terminate the process immediately. Because the termination is an action at runtime and returning a value is a compile time requirement. |
we didn't meet any compile error report before so seems it is not have to. |
That's because we allow void-returning handlers which triggerred the runtime failure: https://tracker.ceph.com/issues/64556 |
|
@liu-chunmei @cyx1231st I've just modified this pr to switch to |
061115a to
7ebe08a
Compare
|
jenkins retest this please |
1 similar comment
|
jenkins retest this please |
|
I suppose this PR is good, remove if there are any concerns ^ |
There was a problem hiding this comment.
Before this commit ep was an r-value reference; now technically it an instance of std::exception_ptr constructed from r-value. I haven't checked whether this brings any penalty but is the change intentional?
There was a problem hiding this comment.
Ah, sorry, this is not intentional, will correct it.
There was a problem hiding this comment.
just a nit: per the convention in the file – Func&& f.
There was a problem hiding this comment.
std::forward. I guess the intention is to perfectly forward f.
7ebe08a to
fbd364b
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Signed-off-by: Xuehan Xu <[email protected]>
switch to errorator::asserts Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
fbd364b to
0043fa9
Compare
|
jenkins test api |
|
@rzarzynski @athanatos does the fix look good to you? |
|
@athanatos @Matan-B Looks the failures are unrelated to this PR, are you good with the test results? |
Fixes: https://tracker.ceph.com/issues/64556
Signed-off-by: Xuehan Xu [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e