-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Employ consistent error handling policy and make fatal error conditions fail fast #371
Comments
should assertions depend on a macro (1.b)?The following considerations are relevant:
|
1 and 2 sound like one always wants them (currently we do Release and RelWithDebugInfo builds with O2, is it enough for mentioned optimizations to be found?), 3 feels like an optional optimization, which we could add as a compile-time decision, e.g. #include <cstdlib>
namespace fair::mq {
inline void AssertPre(bool cond) noexcept { if(!cond) { [[unlikely]] @ABORT@; } }
inline void AssertPost(bool cond) noexcept { if(!cond) { [[unlikely]] @ABORT@; } }
} At CMake configure time |
Ok, |
Triggered by a discussion in the Alice WP3 mailing list about error handling, I propose to employ the following error handling "policy" (more in the sense of a guideline and less in the sense of a strict ruleset, simply to achieve more consistency over randomness) for FairMQ:
NDEBUG
or a separate switch (gsl
's runtime asserts are not disabable at all even for release builds)noexcept
and strongly typed error codes via return channel - in the future: replace error codes with static exceptionsnoexcept
interface internally callsnoexcept(false)
interfaces and decide if the "Prefernoexcept
" can hold as a guideline.<system_error>
,std::experimental::expected
, Boost.Outcome or similarstd::bad_alloc
andstd::runtime_error("not implemented")
).std::terminate
, especially in combination withnoexcept
interfaces, with regard to debuggabilityThe above work-in-progress guidelines try to optimize for
Once the above points are finished:
Cc: @davidrohr, @ihrivnac, @ktf just FYI, this will take a bit to finish, but I guess we are not in a huge hurry here and it should not really block any activities in Alice O2 projects.
References:
The text was updated successfully, but these errors were encountered: