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

Investigate potential deadlocks in LockState

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      It seems that Resource Mutexes are never released during a yield, this has the potential to lead to deadlocks as in the following case we would have one:

      Thread A takes Lock A -> Lock B -> Resource Mutex A

      Thread A yields

      Thread B takes Lock B -> Waits until Resource Mutex A is available

      Thread A wakes -> Lock A -> Wait until Lock B is available

       

      Additionally it seems that the order of the locks taken is broken when storing in the LockSnapshot here. This is also unsafe, as it can cause deadlocks too as the order of locks when taken is potentially not the same after a yield and reacquiring them.

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            jordi.olivares-provencio@mongodb.com Jordi Olivares Provencio
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: