db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brett Bergquist (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5560) Java deadlock between LogicalConnection40 and ClientXAConnection40
Date Wed, 28 Dec 2011 18:38:30 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176749#comment-13176749
] 

Brett Bergquist commented on DERBY-5560:
----------------------------------------

Partial stack trace of first thread:


	at org.apache.derby.client.ClientPooledConnection.recycleConnection(ClientPooledConnection.java:353)
	- waiting to lock <0xfffffffc80843f18> (a org.apache.derby.client.ClientXAConnection40)
	at org.apache.derby.client.am.LogicalConnection.close(LogicalConnection.java:91)
	- locked <0xfffffffc85f35508> (a org.apache.derby.client.am.LogicalConnection40)
	at com.sun.gjc.spi.ManagedConnection.transactionCompleted(ManagedConnection.java:492)
	at com.sun.gjc.spi.XAResourceImpl.commit(XAResourceImpl.java:88)
	at com.sun.jts.jtsxa.OTSResourceImpl.commit_one_phase(OTSResourceImpl.java:166)
	at com.sun.jts.CosTransactions.RegisteredResources.commitOnePhase(RegisteredResources.java:1575)
	at com.sun.jts.CosTransactions.TopCoordinator.commitOnePhase(TopCoordinator.java:2949)
	at com.sun.jts.CosTransactions.CoordinatorTerm.commit(CoordinatorTerm.java:317)
	at com.sun.jts.CosTransactions.TerminatorImpl.commit(TerminatorImpl.java:250)
	- locked <0xfffffffc8597bea0> (a com.sun.jts.CosTransactions.TerminatorImpl)
	at com.sun.jts.CosTransactions.CurrentImpl.commit(CurrentImpl.java:623)
	at com.sun.jts.jta.TransactionManagerImpl.commit(TransactionManagerImpl.java:309)
	at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.commit(J2EETransactionManagerImpl.java:1003)
	at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:398)

Partial stack trace of second thread:


	at org.apache.derby.client.am.LogicalConnection.nullPhysicalConnection(LogicalConnection.java:64)
	- waiting to lock <0xfffffffc85f35508> (a org.apache.derby.client.am.LogicalConnection40)
	at org.apache.derby.client.ClientPooledConnection.close(ClientPooledConnection.java:204)
	- locked <0xfffffffc80843f18> (a org.apache.derby.client.ClientXAConnection40)
	at org.apache.derby.client.ClientXAConnection.close(ClientXAConnection.java:139)
	- locked <0xfffffffc80843f18> (a org.apache.derby.client.ClientXAConnection40)
	at com.sun.gjc.spi.ManagedConnection.destroy(ManagedConnection.java:276)
	at com.sun.enterprise.resource.ConnectorAllocator.destroyResource(ConnectorAllocator.java:175)
	at com.sun.enterprise.resource.AbstractResourcePool.destroyResource(AbstractResourcePool.java:986)
	at com.sun.enterprise.resource.AbstractResourcePool.emptyPool(AbstractResourcePool.java:1635)
	- locked <0xfffffffc72af99c0> (a com.sun.enterprise.resource.SJSASResourcePool)
	at com.sun.enterprise.resource.AbstractResourcePool.doFailAllConnectionsProcessing(AbstractResourcePool.java:1213)
	at com.sun.enterprise.resource.AbstractResourcePool.resourceErrorOccurred(AbstractResourcePool.java:1163)
	- locked <0xfffffffc72af99c0> (a com.sun.enterprise.resource.SJSASResourcePool)
	at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool(PoolManagerImpl.java:445)
	at com.sun.enterprise.resource.PoolManagerImpl.resourceErrorOccurred(PoolManagerImpl.java:411)
	at com.sun.enterprise.resource.ConnectorAllocator$ConnectionListenerImpl.connectionErrorOccurred(ConnectorAllocator.java:98)
	at com.sun.gjc.spi.ManagedConnection.connectionErrorOccurred(ManagedConnection.java:662)
	at com.sun.gjc.spi.ManagedConnectionFactory.getInvalidConnections(ManagedConnectionFactory.java:249)
	at com.sun.enterprise.resource.AbstractConnectorAllocator.getInvalidConnections(AbstractConnectorAllocator.java:99)
	at com.sun.enterprise.resource.AbstractConnectorAllocator.isConnectionValid(AbstractConnectorAllocator.java:111)
	at com.sun.enterprise.resource.AbstractResourcePool.isConnectionValid(AbstractResourcePool.java:722)
	at com.sun.enterprise.resource.AbstractResourcePool.getUnenlistedResource(AbstractResourcePool.java:668)
	at com.sun.enterprise.resource.AbstractResourcePool.internalGetResource(AbstractResourcePool.java:609)
	at com.sun.enterprise.resource.AbstractResourcePool.getResource(AbstractResourcePool.java:458)
	at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:248)
	at com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
	at com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:337)
	at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:189)
	at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
	at com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:158)

                
> Java deadlock between LogicalConnection40 and ClientXAConnection40
> ------------------------------------------------------------------
>
>                 Key: DERBY-5560
>                 URL: https://issues.apache.org/jira/browse/DERBY-5560
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.8.2.2
>         Environment: Solaris 10
> Glassfish V2.1.1 
> ClientXADataSource connection pool setup to close all connections on any error
>            Reporter: Brett Bergquist
>
> There is a Java deadlock between LogicalConnection40 and ClientXAConnection40.  The order
of calls that cause the deadlock are:
> Thread 1
> ----
> LogicalConnection.close
> ClientPooledConnection.recycleConnection
> Thread 2
> ----
> ClientPooledConnection.close
> LogicalConnection.nullPhysicalConnection
> Thread 1 acquires a lock on the LogicalConnection and attempts to acquire a lock on the
ClientPooledConnection
> Thread 2 acquires a lock on the ClientPooledConnection and attempts to acquire a lock
on the LogicalConnection
> In production this occurs when one thread is committing a transaction and another thread
is trying to close the connection.  This occurred because the Glassfish connection pool is
setup to close all connections on any error on any connection and an error has been detected
on another connection in the pool.

--
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