-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
Labels:
-
Service Arch
-
4
One of the defining purposes of failpoints is that they should be free when not enabled, in order to make it reasonable to liberally use them even in fairly hot codepaths.
There are at least two issues adding unnecessary costs to disabled failpoints:
- There is an extra memory read to invariant that the fail point is ready, even in production builds.
- The fast-path check is no longer inlined, so it always calls the out-of-line function. And because the out-of-line function contains the whole code path rather than just the fast check, it needs to do all of the expensive prolog and epilog, including stack-smash protection.
In addition to solving these, we should evaluate what it would take to give failpoint a constexpr constructor (so that it is created during const-init rather than dynamic-init), and ideally a trivial destructor, so that it never gets destroyed.