Bugs item #491613, was opened at 2001-12-11 08:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=491613&group_id=22866
Category: JBossMQ Group: v2.4 (stable) >Status: Closed >Resolution: Fixed Priority: 7 Submitted By: Christian Riege (lqd) Assigned to: David Maplesden (dmaplesden) Summary: Server stops delivering messages to MDBs Initial Comment: hi, we found a very hard to reproduce bug in JBossMQ; it *might* be a race condition. We tracked the problem down to the interaction between org.jboss.mq.server.BasicQueue and org.jboss.mq.SpyConnectionConsumer. Here's what happens: SpyConnectionConsumer.java reaches line 105 (commented "unwanted msg") and delivers a NACK. BasicQueue.java receives the NACK and tries to restore the message using the restoreMessage() method. However, from that point of time *NO* receiver is being added to the receivers list in BasicQueue.java, resulting in the internal message queue growing without EVER delivering any messages anymore. This *only* happens when Line 105 in SpyConnectionConsumer.java is invoked -- if my MDB calls setRollbackOnly(), everything continues working. As I said, this is *very* hard to reproduce and my guess is on a race condition. We tried to fix this on our own but got lost in the MQ magic. P.S.: Running JBoss 2.4.4 CVS as of today but this bug has been in before as it seems, we're getting the same behaviour on a vanilla 2.4.3 configuration. I'll try to come up with a testcase if you need it. ---------------------------------------------------------------------- >Comment By: Christian Riege (lqd) Date: 2001-12-12 02:12 Message: Logged In: YES user_id=176671 david, the patch in CVS does the job. thanks for the quick fix. marking as "Closed, Fixed" on sourceforge. ---------------------------------------------------------------------- Comment By: David Maplesden (dmaplesden) Date: 2001-12-11 14:40 Message: Logged In: YES user_id=298030 OK I have applied a change to CVS which I am almost certain will fix the problem. It works for me but I guess that is no guarantee it will work for you. If you could test it with your setup and let me know how it goes. If all is good I can close this bug report. ---------------------------------------------------------------------- Comment By: David Maplesden (dmaplesden) Date: 2001-12-11 12:08 Message: Logged In: YES user_id=298030 Hi, you are correct, I have looked at the code and this is being caused by a race condition very similar to one we fixed recently in SpyMessageConsumer. It will be fixed shortly. What is essentially happening is in the run() method the call to connection.receive() is occuring but returning null because no message is waiting for the bean. Then, before the waitingForMessage flag is set to true a couple of lines later, a message arrives at the server for the bean and is delivered to the connection consumer using addMessage(). This then rejects the message because the flag is not set. The consumer is then frozen because the run() now sets the flag to true and waits for a message to arrive (which never does). There is an easy fix which simply involves moving the connection.receive() call inside the synchronized block. ---------------------------------------------------------------------- Comment By: Christian Riege (lqd) Date: 2001-12-11 08:19 Message: Logged In: YES user_id=176671 ooops, forgot one maybe important detail: if i have multiple MDB's deployed, the effect will only show up on a per-bean basis. i.e. i have one bean which is b0rked while other MDB's are running along just fine. obviously the effect shows up on the bean with the heaviest traffic first but the other beans get affected after a certain amount of time, too. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=491613&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
