AtomicAction and ThreadActionData cleanup is broken
---------------------------------------------------
Key: JBTM-742
URL:
https://jira.jboss.org/browse/JBTM-742
Project: JBoss Transaction Manager
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.6.1.CP05, 4.11.0
Reporter: Andrew Dinn
Assignee: Mark Little
Fix For: 4.12.0, 4.6.1.CP06
ThreadActionData emlpoys a ThreadLocal to maintain the association between threads and
actions. This means that the association can only be removed by the associated thread. The
finalize method on AtomicAction attempts, amongst other things, to ensure this
association is broken by calling ThreadActionData.purgeAction(). Unfortunately it passes
the current thread (the Finalizer thread) which means that the association is still
retained. This also fails to remove any child thread from the basic action's child
thread list for the same reason. Because it has no way of establishing the prior
association this finalize method is an expensive waste of time. It would be best deleted.
Also, another detail of this cleanup is wrong. AtomicAction.removeThread(t) currently
calls ThreadActionData.purgeAction(this). It should call
ThreadActionData.purgeAction(this, t). This change would allow a cleanup thread which
knows about the association to remove the correct child thread from the basic action's
child thread list. However, it will oto get round the problem that ThreadActionData is
using a ThreadLocal. Again, since there is no way of knowing the prior association this
method is probably redundant.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira