Patches item #529076, was opened at 2002-03-12 20:20
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=529076&group_id=22866

Category: JBossMQ
Group: v2.4 (stable)
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Bartmann (bartmann)
Assigned to: Nobody/Anonymous (nobody)
Summary: thread/memory leak in ClientConsumer

Initial Comment:
symptom:

under certain circumstances the 2.4.4 release
of ClientConsumer is not closed correctly, leading
to a big thread-leak which only triggers under a
race condition (my setting produced 1 lost thread
per message/second on linux), making the system
unusable after a few minutes.

explanation:

the close() method might trigger notifyAll()
when the thread is not in wait(). it might
afterwards block in wait() forever.
we should just check for closed before waiting,
so this cannot happen.
The MAIN-branch seems to have changed things
completely, so this is only relevant for 2.4.4.

patch follows:

diff -rub orig/org/jboss/mq/server/ClientConsumer.java
patched/org/jboss/mq/server/ClientConsumer.java
--- orig/org/jboss/mq/server/ClientConsumer.java      
 Wed Nov 28 07:15:32 2001
+++ patched/org/jboss/mq/server/ClientConsumer.java   
 Tue Mar 12 19:48:34 2002
@@ -228,6 +228,10 @@
          {
             while ( messages.size() == 0 )
             {
+               if ( closed )
+               {
+                  return;
+               }
                try
                {
                   messages.wait();
@@ -235,10 +239,6 @@
                catch ( InterruptedException e )
                {
                }
-               if ( closed )
-               {
-                  return;
-               }
             }

             job = new ReceiveRequest[messages.size()];


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=529076&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to