You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2009/05/31 00:49:20 UTC

DO NOT REPLY [Bug 47290] New: Infinite loop on connection factory lookup

https://issues.apache.org/bugzilla/show_bug.cgi?id=47290

           Summary: Infinite loop on connection factory lookup
           Product: JMeter
           Version: Nightly (Please specify date)
          Platform: PC
        OS/Version: Windows Vista
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: cafed00d@gmail.com


Created an attachment (id=23732)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23732)
Patch for protocol.jms.client.ConnectionFactory

I screwed up when I defined the JNDI information for JMS Publisher/Subscriber
samplers. When I ran the test script JMeter seemed to hang. I could also hear
my disk rattling. I had to kill the process. I went to jmeter.log to see what
the problem was an noticed that it was 1GB in size! That lead me to the code in
...protocol.jms.client.ConnectionFactory, where to my amazement there was an
infinite loop - the lookup method looped generating error log entries until if
found the connection factory. Unfortunately, whoever coded this method
originally left no clue as to why there was an infinite loop here.

The patch that is attached assumes that the original coder had a valid reason
for retrying the lookup if it failed the first time. But it also places a limit
on the amount of time spent in doing a lookup and pauses between each attempt.
Personally, I would rather have aborted after the first lookup failed, but I
gave the original coder the benefit of the doubt and thus assumed that the
retry was done for a purpose.

Needless to say, I added comments that explain exactly why the method is now
coded the way it. This will help the next poor soul who stumbles across this
code and wonders why it does what it does. I wish that all code was commented
this way. I know that I demand it of all the people who work on projects with
me.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 47290] Infinite loop on connection factory lookup

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47290





--- Comment #5 from Sebb <se...@apache.org>  2009-06-04 08:53:40 PST ---
SVN details:

URL: http://svn.apache.org/viewvc?rev=781765&view=rev
Log:
apply patch from Peter Johnson. the retry is set to 5 times.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 47290] Infinite loop on connection factory lookup

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47290





--- Comment #1 from peter lin <wo...@yahoo.com>  2009-06-04 07:50:58 PST ---
Thanks for catching that. The patch looks ok. Is there a reason why the retry
in the patch was set so high?

I must have spaced when I wrote that back in 2005.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 47290] Infinite loop on connection factory lookup

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47290


peter lin <wo...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #4 from peter lin <wo...@yahoo.com>  2009-06-04 08:11:15 PST ---
changing status to fixed using the patch provided by Peter Johnson.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 47290] Infinite loop on connection factory lookup

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47290





--- Comment #6 from Peter Johnson <ca...@gmail.com>  2009-06-04 17:20:34 PST ---
A retry limit of five times is fine by me, and is what I though would be
reasonable when I wrote the patch. That is one of the reasons why I set the
limit, and the pause time, as constants.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 47290] Infinite loop on connection factory lookup

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47290





--- Comment #2 from peter lin <wo...@yahoo.com>  2009-06-04 07:57:16 PST ---
>From my experience in the past with JMS. Some JMS providers fail on the first
try on JNDI lookup. clearly, it should have set a limit on retry, but looks
like I spaced and never went back and cleaned up the initial implementation.
The sad and funny thing is, I've written jms connection factories several times
and had a set number of retries. the bug was there purely due to laziness on my
part.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 47290] Infinite loop on connection factory lookup

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47290





--- Comment #3 from peter lin <wo...@yahoo.com>  2009-06-04 08:05:22 PST ---
I've applied the patch and made a note it retries 5 times before giving up.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org