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

Have a client observer destroy ClientOutOfLineExecutor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.4.1, 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v4.4
    • Service arch 2020-06-29
    • 9

      ClientOutOfLineExecutor is a decoration on Client, and it manages a MultiProducerSingleConsumerQueue to keep track of scheduled tasks. In its destructor method, ClientOutOfLineExecutor modifies the queue by closing its producer end and executing the scheduled task. The queue internally acquires and releases a lock to allow safe concurrent accesses. When testing diagnostics and tests commands are enabled, the queue would also run LatchAnalyzer methods (e.g., onAcquire) as part of accessing its internal mutex.

      Since the destructor is invoked during the destruction of the Client object, and LatchAnalyzer also uses decorators (e.g., LatchSetState) to store Client metadata, running the destructor for ClientOutOfLineExecutor could potentially cause read-after-delete memory accesses.

      To fix this issue, we should have an observer run the logic currently implemented by the destructor for ClientOutOfLineExecutor during Client destruction, to prevent the possibility for read-after-delete accesses.

            Assignee:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: