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

Flavia Rainone (JIRA) jira-events at lists.jboss.org
Thu Jan 24 07:07:21 EST 2008


    [ http://jira.jboss.com/jira/browse/JBAOP-501?page=comments#action_12396542 ] 
            
Flavia Rainone commented on JBAOP-501:
--------------------------------------

The status failed should never happen, and this means that task 380 may have to be reopened (or we should create another one since now the info field never becomes null... it is something related to the chain).
I wonder what is causing this failure... we have a read lock before checking the interceptor chain size and before generating the joinpoint class. We have a write lock before starting to rebuild the chains. So, the code executed should always be consistent, i.e., should call the interceptor class added in the beginning of the test method.

> 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