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

Have a client observer destroy ClientOutOfLineExecutor

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.1, 4.7.0
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.4
    • Sprint:
      Service arch 2020-06-29
    • Linked BF Score:
      9

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: