[jboss-jira] [JBoss JIRA] Commented: (JBAOP-501) Deadlock involving exclusively AspectManager and ClassLoader locks

Kabir Khan (JIRA) jira-events at lists.jboss.org
Tue Jan 22 08:50:21 EST 2008


    [ http://jira.jboss.com/jira/browse/JBAOP-501?page=comments#action_12396156 ] 
            
Kabir Khan commented on JBAOP-501:
----------------------------------

Exception in thread "Thread-0" java.lang.RuntimeException: Status failed!!!!
        at org.jboss.test.aop.rebuildingchain.SyncThread.org$jboss$test$aop$rebuildingchain$SyncThread$checkStatus$aop(SyncThread.java:55)
        at org.jboss.test.aop.rebuildingchain.SyncThread.access$1(SyncThread.java)
        at org.jboss.test.aop.rebuildingchain.SyncThread$SyncThreadAdvisor.checkStatus_N_2986406375185073882(SyncThread$SyncThreadAdvisor.java)
        at org.jboss.test.aop.rebuildingchain.SyncThread.checkStatus(SyncThread.java)
        at org.jboss.test.aop.rebuildingchain.SyncThread.run(SyncThread.java:41)

i.e. there is no SyncInterceptor. I wonder if this is a timing issue, and that the chains don't get time to get rebuilt?

> Deadlock involving exclusively AspectManager and ClassLoader locks
> ------------------------------------------------------------------
>
>                 Key: JBAOP-501
>                 URL: http://jira.jboss.com/jira/browse/JBAOP-501
>             Project: JBoss AOP
>          Issue Type: Sub-task
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.0.0.CR2
>            Reporter: Flavia Rainone
>             Fix For: 2.0.0.GA
>
>         Attachments: aop_deadlock.txt
>
>
> This deadlock involves only the AspectManager and the class loader locks. The scenario, result of a rebuildingchain test execution, follows:
> -Thread 0 (org.jboss.test.aop.rebuldingchain.SyncThread)
>  When this thread calls the joinpoint SyncThread.checkStatus, its wrapper is executed. This wrapper needs to generate the Joinpoint class to perform the interception and, for that, it has to acquire the read lock for InterceptorChain.  This thread starts waiting for Thread1 to release the interceptor chain write lock.
> - Thread 1 (org.jboss.test.aop.rebuildingchain.RebuildThread)
>   This thread adds a binding to AspectManager. As part of the addBinding method execution, the AspectManager lock is acquired. As soon as the binding is addded to the bindings collection, the affected advisors have to rebuild their interceptor chains. SyncThread advisor is the affected advisor in this scenario and, to rebuild chains, it needs the write lock for the SyncThread.checkStatus inteceptor chain. This lock is acquired and the rebuild chain algorithm starts being executed. During the finalization of fhe chains, interceptors are created. For that, the interceptor class needs to be loaded, so this thread starts waiting for the class loader lock, held by Main Thread.
> - Main Thread
> Test tries to finish execution (without joining the other threads) and, for that, it starts loading a class, acquiring the class loader lock. The class loading proccess triggers AOPTransformer, that tries to transform the loaded class. For that, the AspectManager lock, held by Thread1, is required, so thist thread starts waiting for that lock.
> Notice that the deadlock involves only Thread1 and MainThread (Thread0 is present only for completion).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list