Bug 51925

Summary: Calling Stop on Test leaks executor threads when concurrent download of resources is on
Product: JMeter - Now in Github Reporter: Philippe Mouawad <p.mouawad>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal CC: p.mouawad
Priority: P2    
Version: 2.5.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Test Case
Fix to the issue
Fix to the issue
Fix to issue

Description Philippe Mouawad 2011-09-30 08:06:40 UTC
Created attachment 27644 [details]
Test Case

Hello,
If you setup a test with :
- Retrieve All embedded Resources from HTML files
- Use concurrent pool size to 4

You run a test and stop while a concurrent download is running.
You will end up leaking 4 threads that were started by ThreadPoolExecutor.

To reproduce issue:
1) Put a breakpoint at line ASyncSample#call 
2) Start a test
3) Wait for stop a these breakpoints
4) Call stop
5) Let all threads run

You will end up with 4 threads called :
pool-1-thread-1
pool-1-thread-3
pool-1-thread-2
pool-1-thread-4


Regards
Philippe
Comment 1 Philippe Mouawad 2011-09-30 08:09:17 UTC
Created attachment 27645 [details]
Fix to the issue

Fix that calls shutdownNow in finally if shutdown did not run.

Regards
Philippe Mouawad
Comment 2 Philippe Mouawad 2011-09-30 08:10:04 UTC
Created attachment 27646 [details]
Fix to the issue
Comment 3 Philippe Mouawad 2011-10-04 14:34:20 UTC
Created attachment 27684 [details]
Fix to issue

Updated to last revision.
Hope you can take it into account soon.
Regards
Philippe M.
Comment 4 Sebb 2011-10-04 23:41:54 UTC
Patch looks OK, however when Bug 51957 is fixed, the try clause can complete normally without all tasks having completed.

One way to fix this would be to call awaitTermination again with a very short timeout; the return value will indicate whether any tasks remain to be stopped.
Comment 5 Sebb 2011-10-05 00:29:28 UTC
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
Comment 6 The ASF infrastructure team 2022-09-24 20:37:47 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2572