Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1
    • Fix Version/s: 1.1.2
    • Labels:
      None
    • Environment:

      Java 1.5, Windows

      Description

      Reached a deadlock inside common-logging while concurrently re-deploying 2 WARs.
      In each WAR there is an attempt to get a logger:

      private final Log logger = LogFactory.getLog(ContextLoader.class);

      Thread dump:

      [deadlocked thread] Thread-96:
      -----------------------------
      Thread 'Thread-96' is waiting to acquire lock 'java.lang.ref.ReferenceQueue@5266e0' that is held by thread 'Thread-102'
      Stack trace:
      ------------
      org.apache.commons.logging.impl.WeakHashtable.purge(WeakHashtable.java:323)
      org.apache.commons.logging.impl.WeakHashtable.rehash(WeakHashtable.java:312)
      java.util.Hashtable.put(Hashtable.java:414)
      org.apache.commons.logging.impl.WeakHashtable.put(WeakHashtable.java:242)
      org.apache.commons.logging.LogFactory.cacheFactory(LogFactory.java:1004)
      org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:657)
      org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
      org.springframework.web.context.ContextLoader.<init>(ContextLoader.java:145)

      [deadlocked thread] Thread-102:
      ------------------------------
      Thread 'Thread-102' is waiting to acquire lock 'org.apache.commons.logging.impl.
      WeakHashtable@1e02138' that is held by thread 'Thread-96'
      Stack trace:
      ------------
      java.util.Hashtable.remove(Hashtable.java:437)
      org.apache.commons.logging.impl.WeakHashtable.purgeOne(WeakHashtable.java:338)
      org.apache.commons.logging.impl.WeakHashtable.put(WeakHashtable.java:238)
      org.apache.commons.logging.LogFactory.cacheFactory(LogFactory.java:1004)
      org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:657)
      org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
      org.springframework.web.context.ContextLoader.<init>(ContextLoader.java:145)

        Attachments

        1. BugDeadlock.java
          0.8 kB
          Philippe Mouawad
        2. Patch-WeakHashtable-1.1.1.txt
          2 kB
          Philippe Mouawad

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nniv Nitzan Niv
              • Votes:
                3 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: