Bug 1261268

Summary: Heavy load causes WARN: "(HornetQ-client-global-threads-16711231)] WARN org.hornetq.core.client - HQ214021: Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently."
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: xuzhan
Component: HornetQAssignee: Chao Wang <chaowan>
Status: CLOSED NOTABUG QA Contact: Miroslav Novak <mnovak>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.0CC: cdewolf, chaowan, csuconic, msvehla
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-09 22:33:49 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:

Description xuzhan 2015-09-09 05:46:02 UTC
Description of problem:
When sending message faster then 0.1s, the WARN below will be shown frequently.

Version-Release number of selected component (if applicable):
JBoss EAP 6.4.0

How reproducible:
Using attached project is able to reproduce.

Steps to Reproduce:
1. starting JBoss EAP 6.4 with attached standalone-full.xml;
2. create user with "admin" role;
3. import "JMSTEST" project in IDE, change IP and username/password from "JMSTEST\config\OP_ServerInfo.properties" and "JMSTES\src\com\datangmobile\op\jms\JmsSender.java" adapt to your environment;
4. right click "JmsSender.java" -->Run As --> Java Application;
5. go into "JmsSender.java", if set little value to Thread.sleep like "Thread.sleep(5)", this WARN will be shown frequently.
   if set large value like "200" in it: "Thread.sleep(200)", this WARN will be gone.

Actual results:
~~~
17:04:40.224 [Thread-1 (HornetQ-client-global-threads-16711231)] WARN  org.hornetq.core.client - HQ214021: Invalid concurrent session usage. Sessions are not supposed to be used by more than one thread concurrently.
java.lang.Exception: trace
	at org.hornetq.core.client.impl.ClientSessionImpl.startCall(ClientSessionImpl.java:1333) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientSessionImpl.acknowledge(ClientSessionImpl.java:808) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientConsumerImpl.doAck(ClientConsumerImpl.java:1240) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientConsumerImpl.acknowledge(ClientConsumerImpl.java:833) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientMessageImpl.acknowledge(ClientMessageImpl.java:96) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:133) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:1117) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientConsumerImpl.access$500(ClientConsumerImpl.java:57) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:1252) [jboss-client.jar:7.5.0.Final-redhat-21]
	at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:105) [jboss-client.jar:7.5.0.Final-redhat-21]
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_14]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_14]
	at java.lang.Thread.run(Thread.java:619) [na:1.6.0_14]
~~~


Expected results:
No such WARNs.

Additional info:

Comment 7 Clebert Suconic 2015-09-09 22:34:43 UTC
To fix this use proper session isolation.. one session per Thread and you won't see such exceptions. It's user's application.. 


This is actually a feature. We added this to prevent other issues.