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

Don't let exception escape ThreadPoolTaskExecutor callback

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • ALL
    • Networking & Obs 2024-12-23
    • 200
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      In SingleServerDiscoveryMonitor::_scheduleNextHello we will schedule a callback on our executor to send a hello. This is done via calling SingleServerDiscoveryMonitor::_doRemoteCommand(). _doRemoteCommand() itself schedules another callback. Let's call the outer layer callback A and the inner layer callback B.

      If callback B's handle returns a bad status, _doRemoteCommand() will throw an exception from that status. This will then bubble back up to callback A.

      This is a violation of the contract for TaskExecutor::scheduleWorkAt, which explicitly states that callbacks given to the executor must not throw exceptions.

      This contract violation has caused a crash via the linked BF, and must be fixed.

            Assignee:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Reporter:
            blake.oler@mongodb.com Blake Oler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: