Bug 1480095

Summary: [GSS](6.4.z) Potential for deadlock on pool's flush
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Tom Ross <tom.ross>
Component: JCAAssignee: Radovan STANCEL <rstancel>
Status: CLOSED CURRENTRELEASE QA Contact: Jiří Bílek <jbilek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bmaxwell, dosoudil, jpederse, rstancel
Target Milestone: CR1   
Target Release: EAP 6.4.19   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-16 11:04:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1436227, 1498153    

Description Tom Ross 2017-08-10 07:00:39 UTC
There is a potential for deadlock on all flushes in pools. The problem is that flush is synchronized and inside the flush the code can be delegated to listeners, that are external to IronJacamar.
If those listeners use their own synchronization system , they could require synchronization locking in themselves. If there is another thread locking the listener and at some point invoking an operation that results in a pool flush, the system could enter a deadlock state.
An example of stack trace:
Found one Java-level deadlock:
=============================
"JMSCCThreadPoolWorker-18":
  waiting to lock monitor 0x00007f1d2409ff48 (object 0x00000007853ad060, a org.jboss.jca.core.connectionmanager.pool.strategy.OnePool),
  which is held by "JMSCCThreadPoolWorker-16"
"JMSCCThreadPoolWorker-16":
  waiting to lock monitor 0x00007f1d1c15d138 (object 0x0000000785998598, a com.ibm.mq.connector.outbound.ConnectionEventHandler),
  which is held by "JMSCCThreadPoolWorker-17"
"JMSCCThreadPoolWorker-17":
  waiting to lock monitor 0x00007f1d2409ff48 (object 0x00000007853ad060, a org.jboss.jca.core.connectionmanager.pool.strategy.OnePool),
  which is held by "JMSCCThreadPoolWorker-16"
 
Java stack information for the threads listed above:
===================================================
"JMSCCThreadPoolWorker-18":
	at org.jboss.jca.core.connectionmanager.pool.AbstractPool.flush(AbstractPool.java:322)
	- waiting to lock <0x00000007853ad060> (a org.jboss.jca.core.connectionmanager.pool.strategy.OnePool)
	at org.jboss.jca.core.connectionmanager.listener.AbstractConnectionListener.connectionErrorOccurred(AbstractConnectionListener.java:368)
	at com.ibm.mq.connector.outbound.ConnectionEventHandler.fireEvent(ConnectionEventHandler.java:141)
	- locked <0x0000000788fe1fa0> (a com.ibm.mq.connector.outbound.ConnectionEventHandler)
	at com.ibm.mq.connector.outbound.ManagedConnectionImpl.onException(ManagedConnectionImpl.java:848)

Comment 5 Jiří Bílek 2018-01-08 10:32:31 UTC
The fix causes regression.
More info about regression in BZ1531005

Reopened.

Comment 7 Jiří Bílek 2018-01-16 16:35:55 UTC
Verified with EAP 6.4.19.CP.CR2