mongobridge data race generating random seeds

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2022-10-17
    • 160
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      A pseudorandom number generator is accessed from multiple threads in mongobridge

      Possible fix:

           PseudoRandom makeSeededPRNG() {
               static StaticImmortal g = PseudoRandom{mongoBridgeGlobalParams.seed};
      +        static Mutex m;
      +        stdx::lock_guard lk{m};
               return PseudoRandom{g->nextInt64()};
          }
      

      Caused the BF-26584 TSAN alert.

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

              Created:
              Updated:
              Resolved: