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

Convert MONGO_INITIALIZERs to std::function

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Build

      The current mechanism for MONGO_INITIALIZER involves passing the name of a function as a string to a callback. To make the callback work, the library containing the initializer must be declared as a public dependency in the library dependency graph.

      We would like to have a mechanism for automatically determining whether a dependency exists between any two nodes of our dependency graph. However, because the current MONGO_INITIALIZER mechanism does not create an explicit symbol dependency between nodes in our library graph, we must treat all declared public dependencies as necessary. This also creates future problems because the libdeps graph continues to grow over time, resulting in a ludicrously large set of intermediate shared libraries in our shared build.

      We propose that the current MONGO_INITIALIZER mechanism be replaced with uses of std::function passed to the callback. This would create a symbol dependency that we're able to analyze with tools such as libabigail. Explicit symbol dependencies would enable us to further develop libdeps graph tools which can automatically trim the graph and allow us to suggest changes which would collapse it into fewer nodes. A smaller libdeps graph would, in turn, result in greatly-reduced build times and start times (see DAG-1964) for dynamic builds.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: