[
https://jira.jboss.org/jira/browse/JBAOP-629?page=com.atlassian.jira.plug...
]
Flavia Rainone commented on JBAOP-629:
--------------------------------------
I started working on an approach that would keep track of whether the binding was already
used in the stack or not. After a while, I found out that this approach was to awkward to
implement and resulted in overhead.
So, I went for using the bindingCollection locks in the AspectManager add and
removeBinding methods.
I'm waiting for a couple of runs from hudson until I"m sure that there are no
deadlocks. After this, I'll close the task.
Synchronize addBinding and removeBinding to avoid duplicate
operations
----------------------------------------------------------------------
Key: JBAOP-629
URL:
https://jira.jboss.org/jira/browse/JBAOP-629
Project: JBoss AOP
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 2.0.0.CR16
Reporter: Flavia Rainone
Assignee: Flavia Rainone
Fix For: 2.0.0.GA
As the addBinding method is synchronized, it is possible that a binding is added to the
binding list and the thread performing this operation is preempted by another thread that
is performing a removal operation.
In this case, the removal operation performed by this second thread could use the newly
added binding in the chains it is rebuilding. When the first thread resumes, it will
rebuild the chains for the added binding, adding interceptors to all affected chains,
ignoring the fact that those chains may already contain those interceptors, because of the
chain rebuild process performed by the second thread.
In this scenario, we will end up with chains containing duplicate interceptors.
Notice that synchronizing the add and remove methods is not an option, as those methods
being synchronized causes a deadlock (see JBAOP-501).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira