commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Orapallo (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOGGING-119) deadlock on re-registration of logger
Date Tue, 27 Mar 2012 14:40:26 GMT

    [ https://issues.apache.org/jira/browse/LOGGING-119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13239515#comment-13239515
] 

Anthony Orapallo commented on LOGGING-119:
------------------------------------------

Has anyone been able to reliably reproduce the issue.  Or get a patch working?  We appear
to be experiencing this issue as well and need a fix.  will upgrading commons-logging.jar
fix the issue?

All threads get blocked waiting for the WeakHashTable object.  The thread holding the object
is this:
"btpool0-193" prio=10 tid=0x00002aaabc7e7800 nid=0x468 waiting for monitor entry [0x0000000050a7d000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.apache.commons.logging.impl.WeakHashtable.purge(WeakHashtable.java:323)
        - waiting to lock <0x00000006e37d3a18> (a java.lang.ref.ReferenceQueue)
        at org.apache.commons.logging.impl.WeakHashtable.rehash(WeakHashtable.java:312)
        at java.util.Hashtable.put(Hashtable.java:412)
        - locked <0x00000006e37cf4d0> (a org.apache.commons.logging.impl.WeakHashtable)

Note that it is waiting to lock a ReferenceQueue object.  The ReferenceQueue object is held
by:

"btpool0-229" prio=10 tid=0x00002aaac0c69800 nid=0x6b07 waiting for monitor entry [0x0000000043fd2000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at java.util.Hashtable.remove(Hashtable.java:435)
        - waiting to lock <0x00000006e37cf4d0> (a org.apache.commons.logging.impl.WeakHashtable)
        at org.apache.commons.logging.impl.WeakHashtable.purgeOne(WeakHashtable.java:338)
        - locked <0x00000006e37d3a18> (a java.lang.ref.ReferenceQueue)

Note that this one is waiting to lock the WeakHashTable object, so the thread lock will never
break, and all the other btpool threads will back up behind it.
                
> deadlock on re-registration of logger
> -------------------------------------
>
>                 Key: LOGGING-119
>                 URL: https://issues.apache.org/jira/browse/LOGGING-119
>             Project: Commons Logging
>          Issue Type: Bug
>    Affects Versions: 1.1.1
>         Environment: Java 1.5, Windows
>            Reporter: Nitzan Niv
>         Attachments: BugDeadlock.java, Patch-WeakHashtable-1.1.1.txt
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message