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

Deadlock in VectorClockMongoD during shutdown

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0, 6.0.15, 5.0.27, 7.0.9, 7.3.2
    • Affects Version/s: 5.0.0, 6.0.0, 7.0.0, 8.0.0-rc0
    • Component/s: None
    • Labels:
      None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v7.3, v7.0, v6.0, v5.0
    • CAR Team 2024-04-01
    • 134

      The problem is coming from a waitForDurableConfigTime call after shutdown initiated.

      After shutdown initiation the ThreadPoolTaskExecutor won't accept more async requests, it will run everything on the same thread.

      Since the VectorClockMongoD relies on the assumption that the futures created in the context of waitForDurableConfigTime will run asynchronously, it locks the same mutex that will be locked in the future as well. Since on shutdown everything run on a single thread, it causes a deadlock (double locking the same mutex on the same thread)

      This behavior never happened before, because earlier the mongod crashed at this point. The fix of the crash revealed the deadlock.

            Assignee:
            adam.farkas@mongodb.com Wolfee Farkas
            Reporter:
            adam.farkas@mongodb.com Wolfee Farkas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: