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

Construct uuidGen on first use to avoid static init order fiasco

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Execution Team 2023-01-09

    Description

      uuidGen is a static object in uuid.cpp . When working on a test I created a static DatabaseVersion with DatabaseVersion::makeFixed() that internally depends on uuidGen. This worked on some build variants but failed in others, this problem is called the static initialization order fiasco.

      We can use the construct on first use idiom to avoid this problem.

      Attachments

        Activity

          People

            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            daniel.gomezferro@mongodb.com Daniel Gomez Ferro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: