Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54586

Failpoints are no longer free when not enabled

    • 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:

      1. There is an extra memory read to invariant that the fail point is ready, even in production builds.
      2. 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.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            2 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated: