Deadlock due to connection pool exhaustion

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Medium
    • Component/s: None
    • None

      StAC hung after the upgrade. I've attached a thread dump and a trimmed down and sorted text file with the request processing threads.

      It looks like there's a deadlock between threads that hold database connections that are waiting to lock either JiraCachingPropertySet or DefaultFieldLayoutManager and threads that hold locks that are blocked waiting for a DB connection.

      I see a few problems here:

      • Threads that are waiting for DB connections never time out, they just hang forever in this case.
      • We don't seem to have configured either the DB pool or the thread pool in Tomcat. The defaults for these are totally out of whack.
      • It's hard to tell which threads actually have DB connections, because of the broken resource acquisition pattern in use, but JIRA should probably be enforcing some kind of resource ordering here, for example by having methods that use internal locking and require a DB connection to require callers to provide the connection.

        1. stac.tdump
          727 kB
        2. stac-2.tdump
          414 kB
        3. stac-thread-analysis.txt
          216 kB

            Assignee:
            Tim Moore [Atlassian]
            Reporter:
            Tim Moore [Atlassian]
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: