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

ThreadPoolTaskExecutor is memory unsafe when task cancellation occurs around the same time an exhaust network response is received

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Sprint:
      Service Arch 2021-10-04, Service Arch 2021-11-15
    • Linked BF Score:
      34
    • Story Points:
      3

      Description

      cbState->callback is modified without holding ThreadPoolTaskExecutor::_mutex in ThreadPoolTaskExecutor::runCallbackExhaust(). This is memory unsafe because cbState->callback is also modified in the exhaust codepath's RemoteCommandOnReplyFn upon task cancellation. This issue has been observed to cause server crashes when shutting down a replica set monitor due to a partially initialized TaskExecutor::CallbackFn callback being invoked.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              billy.donahue Billy Donahue
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: