Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-11308

Deadlock when analyzing a project and updating issues

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.5
    • Component/s: None
    • Labels:
    • Edition:
      Community
    • Production Notes:
      None

      Description

      There is a first step to fix that issue but it was not sufficient.

      The LiveMeasures updates in a single transaction must be ordered in order to prevent this deadlock.

      PersistLiveMeasuresStep$MeasureVisitor#visitAny is doing that only for multiple subsets, so the main issue should be in that loop. A quick solution would be to first store the whole list of liveMeasures, then order that list and execute the insertOrUpdate after visiting all component.

      Other investigated tracks :

      • Escalation mechanism that make the RDBMS lock the table but this does not occur because :
        • the logs is clearly stating "Share Lock"
        • Postgresql does not seems to use this mechanism
      • Multiple live measures with same component uuid and same metric id, but I don't think this will trigger a deadlock (because it's an unique key)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              eric.hartmann Eric Hartmann
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: