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

ServiceContext getters/setters are racing

    • Service Arch
    • Fully Compatible
    • ALL
    • Hide

      BF-18712

      Show
      BF-18712
    • Service arch 2020-10-05, Service arch 2020-10-19, Service Arch 2021-03-08, Service Arch 2021-03-22, Service Arch 2021-04-05, Service Arch 2021-04-19, Service Arch 2021-05-17, Service Arch 2021-07-12, Service Arch 2021-08-09, Programmability 2024-06-10, Programmability 2024-06-24, Programmability 2024-07-08, Programmability 2024-07-22, Programmability 2024-08-05, Programmability 2024-08-19, Programmability 2024-09-02, Programmability 2024-09-16, Programmability 2024-09-30, Programmability 2024-10-14, Programmability 2024-10-28
    • 200
    • 4

      BF-18712 shows a TSAN true positive where setFastClockSource races with getFastClockSource due to latch_detail::Mutex::_onContendedLock's invocation of getFastClockSource before the setFastClockSource could occur.

      There is no synchronization on the unique_ptr fields of ServiceContext, so these problems are unavoidable. Rather than making new obscure rules about when it's ok to call the getters, we can rather easily add synchronization to these fields, as they are private members. They could be stored in a synchronized unique_ptr wrapper.

       

      Acceptance Criteria: 

      ServiceContext will call terminate if a setter happens after a given property has been accessed. Create a patch build to reproduce this and identify all the use cases where this was happening to create tickets that require a fix. 

            Assignee:
            ryan.berryhill@mongodb.com Ryan Berryhill
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: