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

Construct uuidGen on first use to avoid static init order fiasco

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Execution Team 2023-01-09

      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.

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

              Created:
              Updated:
              Resolved: