mongobridge: fix local static PseudoRandom used after destruction

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • Service Arch 2022-09-19
    • 35
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

          PseudoRandom makeSeededPRNG() {
              static PseudoRandom globalPRNG(mongoBridgeGlobalParams.seed);
              return PseudoRandom(globalPRNG.nextInt64());
          }
      

      This instance will not be valid as the process is shutting down.
      Fix:

          PseudoRandom makeSeededPRNG() {
              static StaticImmortal globalPRNG = 
                  PseudoRandom(mongoBridgeGlobalParams.seed);
              return PseudoRandom(globalPRNG->nextInt64());
          }

      Caused BF-26284

            Assignee:
            Billy Donahue
            Reporter:
            Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: