db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-5552) Derby threads hanging when using ClientXADataSource and a deadlock or lock timeout occurs
Date Thu, 23 Feb 2012 21:02:49 GMT

     [ https://issues.apache.org/jira/browse/DERBY-5552?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Kathey Marsden updated DERBY-5552:
----------------------------------

    Attachment: derby-5552_withexpanded_test_diff.txt

Attached is a new patch derby-5552_withexpanded_test_diff.txt which expands the test to check
the state of the connections and the transaction table after the lock timeout.  

I think most things are working as expected. 

- The transaction (xid2) that was rolled back due the lock timeout  is no longer in the transaction
table after the lock time out.

- New statements on the connection after the lock timeout start a new local transaction.

 - XAResource.end()  on xid2 fails with an RB_TIMEOUT

- Even though it is not in the transaction table and is holding no locks, xid2  has to be
explicitly rolled back before it can be reused.  This is the one I am not sure about. Should
this be necessary?




                
> Derby threads hanging when using ClientXADataSource and a deadlock or lock timeout occurs
> -----------------------------------------------------------------------------------------
>
>                 Key: DERBY-5552
>                 URL: https://issues.apache.org/jira/browse/DERBY-5552
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.8.1.2
>         Environment: Solaris 10, Glassfish V2.1.1,
>            Reporter: Brett Bergquist
>            Assignee: Kathey Marsden
>            Priority: Blocker
>              Labels: derby_triage10_9
>         Attachments: DERBY-5552-p1.patch, DERBY-5552-p2.patch, ReproDerby5552LockTimeout.java,
appserverstack.txt, client.tar.Z, derby-5552_withexpanded_test_diff.txt, derby-5552_withtest_diff.txt,
derby-5552_withtest_diff.txt, derby.log, derbystackatshutdown.txt, execute.patch, transactionsleft.txt
>
>
> The issue arrives when multiple XA transactions are done in parallel and there is either
a lock timeout or a lock deadlock detected.  When this happens the connection is leaked in
the Glassfish connection pool and the client thread hangs in "org.apache.derby.client.netReply.fill(Reply.java:172)".
 
> Shutting down the app server fails because the thread has a lock in "org.apache.derby.client.net.NetConnection40"
and another task is calling "org.apache.derby.client.ClientPooledConnection.close(ClientPooledConnection.java:214)"
which is waiting for the lock.
> Killing the appsever using "kill" and then attempting to shutdown Derby network server
causes the Network Server to hang.  One of the threads hangs waiting for a lock at "org.apache.derby.impl.drda.NeworkServerControlImpl.removeFromSessionTable(NetworkServerControlImpl.java:1525)"
and the "main" thread has this locked at "org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(NetworkServerControlImpl.java:2242)"
and it itself is waiting for a lock which belongs to a thread that is stuck at "org.apache.derby.impl.services.locks.ActiveLock.waitForGrant(ActiveLock.java:118)
which is in the TIMED_WAITING state.
> Only by killing the Network Server using "kill" is possible at this point.
> There are transactions left even though all clients have been removed.  

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

        

Mime
View raw message