You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2012/06/16 14:58:27 UTC

svn commit: r1350918 - /jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java

Author: sebb
Date: Sat Jun 16 12:58:26 2012
New Revision: 1350918

URL: http://svn.apache.org/viewvc?rev=1350918&view=rev
Log:
JMS Point to Point reports too high response times in Request Response Mode
- ensure the timeout is actually used
Bugzilla Id: 53357

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java

Modified: jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java?rev=1350918&r1=1350917&r2=1350918&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java (original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java Sat Jun 16 12:58:26 2012
@@ -19,6 +19,7 @@
 package org.apache.jmeter.protocol.jms.sampler;
 
 import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -89,7 +90,13 @@ public class FixedQueueExecutor implemen
             if (log.isDebugEnabled()) {
                 log.debug(Thread.currentThread().getName()+" will wait for reply " + id + " started on " + System.currentTimeMillis());
             }
-            countDownLatch.await();
+            // This used to be request.wait(timeout_ms), where 0 means forever
+            // However 0 means return immediately for the latch
+            if (timeout == 0){
+                countDownLatch.await(); //
+            } else {
+                countDownLatch.await(timeout, TimeUnit.MILLISECONDS);
+            }
             if (log.isDebugEnabled()) {
                 log.debug(Thread.currentThread().getName()+" done waiting for " + id + " on "+request+" ended on " + System.currentTimeMillis());
             }



Re: svn commit: r1350918 - /jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java

Posted by sebb <se...@gmail.com>.
It was Eclipse that said the timeout field was not used.

On 16 June 2012 22:50, Philippe Mouawad <ph...@gmail.com> wrote:
> Good catch as you say :-)
>
> On Sat, Jun 16, 2012 at 2:58 PM, <se...@apache.org> wrote:
>
>> Author: sebb
>> Date: Sat Jun 16 12:58:26 2012
>> New Revision: 1350918
>>
>> URL: http://svn.apache.org/viewvc?rev=1350918&view=rev
>> Log:
>> JMS Point to Point reports too high response times in Request Response Mode
>> - ensure the timeout is actually used
>> Bugzilla Id: 53357
>>
>> Modified:
>>
>>  jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
>>
>> Modified:
>> jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
>> URL:
>> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java?rev=1350918&r1=1350917&r2=1350918&view=diff
>>
>> ==============================================================================
>> ---
>> jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
>> (original)
>> +++
>> jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
>> Sat Jun 16 12:58:26 2012
>> @@ -19,6 +19,7 @@
>>  package org.apache.jmeter.protocol.jms.sampler;
>>
>>  import java.util.concurrent.CountDownLatch;
>> +import java.util.concurrent.TimeUnit;
>>
>>  import javax.jms.JMSException;
>>  import javax.jms.Message;
>> @@ -89,7 +90,13 @@ public class FixedQueueExecutor implemen
>>             if (log.isDebugEnabled()) {
>>                 log.debug(Thread.currentThread().getName()+" will wait for
>> reply " + id + " started on " + System.currentTimeMillis());
>>             }
>> -            countDownLatch.await();
>> +            // This used to be request.wait(timeout_ms), where 0 means
>> forever
>> +            // However 0 means return immediately for the latch
>> +            if (timeout == 0){
>> +                countDownLatch.await(); //
>> +            } else {
>> +                countDownLatch.await(timeout, TimeUnit.MILLISECONDS);
>> +            }
>>             if (log.isDebugEnabled()) {
>>                 log.debug(Thread.currentThread().getName()+" done waiting
>> for " + id + " on "+request+" ended on " + System.currentTimeMillis());
>>             }
>>
>>
>>
>
>
> --
> Cordialement.
> Philippe Mouawad.

Re: svn commit: r1350918 - /jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java

Posted by Philippe Mouawad <ph...@gmail.com>.
Good catch as you say :-)

On Sat, Jun 16, 2012 at 2:58 PM, <se...@apache.org> wrote:

> Author: sebb
> Date: Sat Jun 16 12:58:26 2012
> New Revision: 1350918
>
> URL: http://svn.apache.org/viewvc?rev=1350918&view=rev
> Log:
> JMS Point to Point reports too high response times in Request Response Mode
> - ensure the timeout is actually used
> Bugzilla Id: 53357
>
> Modified:
>
>  jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
>
> Modified:
> jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
> URL:
> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java?rev=1350918&r1=1350917&r2=1350918&view=diff
>
> ==============================================================================
> ---
> jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
> (original)
> +++
> jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/FixedQueueExecutor.java
> Sat Jun 16 12:58:26 2012
> @@ -19,6 +19,7 @@
>  package org.apache.jmeter.protocol.jms.sampler;
>
>  import java.util.concurrent.CountDownLatch;
> +import java.util.concurrent.TimeUnit;
>
>  import javax.jms.JMSException;
>  import javax.jms.Message;
> @@ -89,7 +90,13 @@ public class FixedQueueExecutor implemen
>             if (log.isDebugEnabled()) {
>                 log.debug(Thread.currentThread().getName()+" will wait for
> reply " + id + " started on " + System.currentTimeMillis());
>             }
> -            countDownLatch.await();
> +            // This used to be request.wait(timeout_ms), where 0 means
> forever
> +            // However 0 means return immediately for the latch
> +            if (timeout == 0){
> +                countDownLatch.await(); //
> +            } else {
> +                countDownLatch.await(timeout, TimeUnit.MILLISECONDS);
> +            }
>             if (log.isDebugEnabled()) {
>                 log.debug(Thread.currentThread().getName()+" done waiting
> for " + id + " on "+request+" ended on " + System.currentTimeMillis());
>             }
>
>
>


-- 
Cordialement.
Philippe Mouawad.