You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by John Pederzolli <jp...@gmail.com> on 2006/04/04 18:24:16 UTC

Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

I have continued trying to solve this bug, and am currently running AMQ 4.0
RC2.

I found what seems to be the source of the infinite loop - in
MessageDispatchChannel.java, in the method dequeueNoWait (line 91):

    public MessageDispatch dequeueNoWait() {
        synchronized (mutex) {
            if (closed || !running || list.isEmpty()) {
                return null;
            }
            return (MessageDispatch) list.removeFirst();
        }
    }

The thread that keeps on spinning has values of closed=false, running=false,
and a nonEmpty list. With those values, a null is returned up to the run()
method of ActiveMqSession.java (line 640), causing it do do nothing and then
finally up to ServerSessionImpl.java's run() method (line 156) where in the
finally block the following code that is responsible for breaking out of the
while loop (line 170):

            finally {
                InboundContextSupport.unregister(this);                
                log.debug("run loop end");            
                synchronized (runControlMutex) {
                    // This endpoint may have gone stale due to error
                    if( stale) {
                        runningFlag = false;
                        pool.removeFromPool(this);
                        break;
                    }
                    if( !session.hasUncomsumedMessages() ) {
                        runningFlag = false;
                        pool.returnToPool(this);
                        break;
                    }                
                }

Neither break statement is hit since the endpoint is not stale and it has
unconsumed messages - and the infinite loop begins. 

I am not familiar enough with the code to say their is a bug in any of the
classes I just mentioned or there is an external class which is causing the
problem. Do you have any insight into this? I am more than willing to assist
or give additional debug information if needed.  

- John


--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3747724
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by John Pederzolli <jp...@gmail.com>.
https://issues.apache.org/activemq/browse/AMQ-662

That issue (plus my more recent comments) encompasses all the information I
can come up with so far.

Thanks  - John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3770889
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by John Pederzolli <jp...@gmail.com>.
Sounds good -  As soon as a new snapshot is out there I will give it a shot.

- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3775813
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by James Strachan <ja...@gmail.com>.
Great - thanks for letting us know

James

On 4/6/06, John Pederzolli <jp...@gmail.com> wrote:
>
> Good news - it looks like the infinite loop issue has been fixed.
>
> Thank you for your help on this.
>
> - John
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3786872
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/

Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by John Pederzolli <jp...@gmail.com>.
Good news - it looks like the infinite loop issue has been fixed.

Thank you for your help on this.

- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3786872
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Thanks John,

I've just commited a change that I hope fixes the issue for you. 
Please do a build from source or wait for the nightly snapshot, and
try again.

Regards,
Hiram

On 4/5/06, John Pederzolli <jp...@gmail.com> wrote:
>
> Also - As far as helping you test, that not a problem.
>
> - John
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3772457
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--
Regards,
Hiram

Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by John Pederzolli <jp...@gmail.com>.
Also - As far as helping you test, that not a problem.

- John
--
View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3772457
Sent from the ActiveMQ - User forum at Nabble.com.


Re: AMQ 3.2/Spring/Jencks/POJO and XA Transactions

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi John,

Thank for tracking this down.  It's now begining to make more sense. 
Could you open up a jira with the information that you've provided so
far? http://issues.apache.org/activemq/browse/AMQ

I'm working on a fix now.. would you be able to help me test it?

On 4/4/06, John Pederzolli <jp...@gmail.com> wrote:
>
> I have continued trying to solve this bug, and am currently running AMQ 4.0
> RC2.
>
> I found what seems to be the source of the infinite loop - in
> MessageDispatchChannel.java, in the method dequeueNoWait (line 91):
>
>     public MessageDispatch dequeueNoWait() {
>         synchronized (mutex) {
>             if (closed || !running || list.isEmpty()) {
>                 return null;
>             }
>             return (MessageDispatch) list.removeFirst();
>         }
>     }
>
> The thread that keeps on spinning has values of closed=false, running=false,
> and a nonEmpty list. With those values, a null is returned up to the run()
> method of ActiveMqSession.java (line 640), causing it do do nothing and then
> finally up to ServerSessionImpl.java's run() method (line 156) where in the
> finally block the following code that is responsible for breaking out of the
> while loop (line 170):
>
>             finally {
>                 InboundContextSupport.unregister(this);
>                 log.debug("run loop end");
>                 synchronized (runControlMutex) {
>                     // This endpoint may have gone stale due to error
>                     if( stale) {
>                         runningFlag = false;
>                         pool.removeFromPool(this);
>                         break;
>                     }
>                     if( !session.hasUncomsumedMessages() ) {
>                         runningFlag = false;
>                         pool.returnToPool(this);
>                         break;
>                     }
>                 }
>
> Neither break statement is hit since the endpoint is not stale and it has
> unconsumed messages - and the infinite loop begins.
>
> I am not familiar enough with the code to say their is a bug in any of the
> classes I just mentioned or there is an external class which is causing the
> problem. Do you have any insight into this? I am more than willing to assist
> or give additional debug information if needed.
>
> - John
>
>
> --
> View this message in context: http://www.nabble.com/AMQ-3.2-Spring-Jencks-POJO-and-XA-Transactions-t1337311.html#a3747724
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--
Regards,
Hiram