History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1849
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Gary Tully
Reporter: Hans Bausewein
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

Slave threads increasing when sending to temporary queue

Created: 09/Jul/08 10:29 AM   Updated: Today 02:47 PM
Component/s: None
Affects Version/s: 5.2.0
Fix Version/s: 5.2.0

Time Tracking:
Not Specified

File Attachments:
  Size
GZip Archive Licensed for inclusion in ASF works activemqjee-0.0.2-src.tar.gz 2008-07-10 02:41 AM Hans Bausewein 5 kb
Text File jboss.log 2008-07-09 10:29 AM Hans Bausewein 4 kb
Environment:
Pure master/slave
JBoss 4.0.5 GA (on Java 1.5.0_14)
few days old ActiveMQ 5.2.0-SNAPSHOT (on Java "1.6.0_06")


 Description  « Hide
Deployed the attached TextMDB (modified JBoss example) to our JBoss 4.0.5 GA server (cluster).
  • send a message to "queue.A" with Reply To set to "queue.REPLY_A"

The TextMDB bean:

  • creates a temporary queue with NON_PERSISTENT delivery mode
  • forwards message body to "queue.B" and sets the reply queue to this temporary queue
  • another (or the same) instance of TextMDB replies and adds some text, replies to the temporary queue
  • the first TextMDB replies to "queue.REPLY_A"

Works fine, except that every time a temporary queue message is sent, the number of threads on the slave increases by 3.

On the master the threads are destroyed after a while, but on the slave they persist, growing to "OutOfMemoryError: unable to create new native thread"

Temporary queue Thread Name example: TempQueue: ID:{HOSTNAME}-59619-1215591084487-0:16:5
+ 2 topic threads

That thread ID can be found ActiveMQ messages in the attached JBoss log.

Have I created a bug im my code or have I found a bug in the ActiveMQ server?



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Hans Bausewein - 10/Jul/08 02:41 AM
Update 0.0.2:
  • added a stand-alone test
  • delete the temporary queue and close its (locally created) session

The problem on the slave persists.

To run the test do something like:

java -cp conf:lib/log4j-1.2.14.jar:lib/activemq-all-5.2-SNAPSHOT.jar:lib/activemqjee-0.0.2.jar org.activemq.jms.StandaloneApp

With libraries in "lib" and "log4j.xml" and "jndi.properties" in "conf".

"jndi.properties" contains the fail-over URL:

java.naming.provider.url=failover:(tcp://masterhost:61616,tcp://slavehost:61616)

BTW: Pure master/slave does not work with 5.1.0, so I cannot test that one. ( see AMQ-1585 )


Hans Bausewein - 10/Jul/08 03:43 AM
Everytime it happens, I get a ClassCastException in "data/activemq.log" on the slave host:

2008-07-10 11:48:33,907 t: vm://slavehost#1 ERROR Queue - Failed to page in more queue messages
java.lang.ClassCastException: org.apache.activemq.command.ActiveMQTextMessage cannot be cast to org.apache.activemq.broker.region.QueueMessageReference
at org.apache.activemq.broker.region.Queue.messageExpired(Queue.java:1045)
at org.apache.activemq.broker.region.Queue.messageExpired(Queue.java:1037)
at org.apache.activemq.broker.region.Queue.doPageIn(Queue.java:1117)
at org.apache.activemq.broker.region.Queue.pageInMessages(Queue.java:1196)
at org.apache.activemq.broker.region.Queue.iterate(Queue.java:951)
at org.apache.activemq.broker.region.Queue.wakeup(Queue.java:1077)
at org.apache.activemq.broker.region.Queue.sendMessage(Queue.java:1072)
at org.apache.activemq.broker.region.Queue.doMessageSend(Queue.java:470)
at org.apache.activemq.broker.region.Queue.send(Queue.java:413)
at org.apache.activemq.broker.region.AbstractRegion.send(AbstractRegion.java:350)
at org.apache.activemq.broker.region.RegionBroker.send(RegionBroker.java:437)
at org.apache.activemq.broker.TransactionBroker.send(TransactionBroker.java:224)
at org.apache.activemq.broker.BrokerFilter.send(BrokerFilter.java:126)
at org.apache.activemq.broker.CompositeDestinationBroker.send(CompositeDestinationBroker.java:95)
at org.apache.activemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:133)
at org.apache.activemq.broker.TransportConnection.processMessage(TransportConnection.java:437)
at org.apache.activemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:624)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:292)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:180)
at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:104)
at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
at org.apache.activemq.transport.vm.VMTransport.iterate(VMTransport.java:205)
at org.apache.activemq.thread.DedicatedTaskRunner.runTask(DedicatedTaskRunner.java:98)
at org.apache.activemq.thread.DedicatedTaskRunner$1.run(DedicatedTaskRunner.java:36)


Hans Bausewein - 10/Jul/08 08:18 AM
Deployed build 675511 from svn: the exception is gone, but the number of threads on the slave still increases every time I send a message.

Tested both with the stand-alone client and with the TextMDB.


Hans Bausewein - 30/Jul/08 12:03 AM
Tried 680628 yesterday, but the issue is still there.

Any ideas where it fails? Can I do something?


Gary Tully - 05/Sep/08 01:52 PM
temp queues are now cleaned up in the slave.

Hans Bausewein - 05/Sep/08 02:47 PM
That's good news!

I'll test it, monday.