[jbossts-issues] [JBoss JIRA] (JBTM-851) Transaction timeout in JBoss caused deadlock with spring transaction manager

Tom Jenkinson (JIRA) jira-events at lists.jboss.org
Mon Mar 19 15:13:48 EDT 2012

     [ https://issues.jboss.org/browse/JBTM-851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom Jenkinson resolved JBTM-851.

    Fix Version/s:     (was: 5.0.1.Final)
       Resolution: Duplicate Issue

Sorry, I only just got round to reviewing this issue, anyway closing as a duplicate as per Kev's comment:

> Transaction timeout in JBoss caused deadlock with spring transaction manager
> ----------------------------------------------------------------------------
>                 Key: JBTM-851
>                 URL: https://issues.jboss.org/browse/JBTM-851
>             Project: JBoss Transaction Manager
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: JTA
>    Affects Versions: 4.14.0
>         Environment: JBoss 6, JBoss TS 4.14.0.Final, Hibernate 3.6.4.Final, Spring 3.0.5
>            Reporter: Sergey Astakhov
>            Assignee: Tom Jenkinson
>            Priority: Critical
>         Attachments: deadlock.txt
> Deadlock scenario:
> 1. Transaction started. At some point, jdbc connection allocated from poll and registered as transaction resource.
> 2. After timeout event occured, JBoss try to rollback this transaction.
> 3. In process of rolling back transaction, reaper process try to get lock on connection to do rollback and stopped at this point in waiting.
> 4. Due to cancelling state of the transaction, exception is rised in main process of transaction.
> 5. Spring catched this exception and invokes rollback to transaction.
> 6. Inside jboss transaction manager there is synchronized method for making transaction abort, so this rollback invocation is waiting another thread to complete.
> 7. At final: JBoss hold synchronized lock on abort method, but wait for releasing lock on connection. Main process hold lock on connection, but wait for releasing lock on abort method. Deadlock state.
> How this can be fixed:
> Before trying to invoke abort method, check transaction state. If it is already in state of aborting - just rise IllegalStateException.
> I'm also suggest to add similar check in spring code (https://jira.springsource.org/browse/SPR-8421), but such check should be in jboss code too, because any client code can suddenly get into this deadlock state.

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


More information about the jbossts-issues mailing list