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

Investigate potential deadlocks in LockState

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: