Construct uuidGen on first use to avoid static init order fiasco

XMLWordPrintableJSON

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

      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 Gomez Ferro
            Reporter:
            Daniel Gomez Ferro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: