Author: sebb
Date: Wed Oct  5 00:28:51 2011
New Revision: 1179022

URL: http://svn.apache.org/viewvc?rev=1179022&view=rev
Log:
Bug 51925 - Calling Stop on Test leaks executor threads when concurrent 
download of resources is on 

Modified:
    
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
    jakarta/jmeter/trunk/xdocs/changes.xml

Modified: 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1179022&r1=1179021&r2=1179022&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
 Wed Oct  5 00:28:51 2011
@@ -1204,6 +1204,7 @@ public abstract class HTTPSamplerBase ex
                         poolSize, poolSize, KEEPALIVETIME, TimeUnit.SECONDS,
                         new LinkedBlockingQueue<Runnable>());
 
+                boolean tasksCompleted = false;
                 try {
                     // sample all resources with threadpool
                     final List<Future<HTTPSampleResult>> retExec = 
exec.invokeAll(liste);
@@ -1223,10 +1224,15 @@ public abstract class HTTPSamplerBase ex
                             errorResult(e, res);
                         }
                     }
+                    tasksCompleted = exec.awaitTermination(1, 
TimeUnit.MILLISECONDS); // did all the tasks finish?
                 } catch (InterruptedException ie) {
                     log.warn("Interruped fetching embedded resources", ie); // 
$NON-NLS-1$
                 } catch (ExecutionException ee) {
                     log.warn("Execution issue when fetching embedded 
resources", ee); // $NON-NLS-1$
+                } finally {
+                    if (!tasksCompleted) {
+                        exec.shutdownNow(); // kill any remaining tasks
+                    }
                 }
             }
         }

Modified: jakarta/jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/xdocs/changes.xml?rev=1179022&r1=1179021&r2=1179022&view=diff
==============================================================================
--- jakarta/jmeter/trunk/xdocs/changes.xml (original)
+++ jakarta/jmeter/trunk/xdocs/changes.xml Wed Oct  5 00:28:51 2011
@@ -85,6 +85,7 @@ This has been corrected; can still rever
 <li>Bug 51939 - Should generate new parent sample if necessary when retrieving 
embedded resources</li>
 <li>Bug 51942 - Synchronisation issue on CacheManager when Concurrent Download 
is used</li>
 <li>Bug 51957 - Concurrent get can hang if a task does not complete</li>
+<li>Bug 51925 - Calling Stop on Test leaks executor threads when concurrent 
download of resources is on</li>
 </ul>
 
 <h3>Other Samplers</h3>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to