Bug 51925 - Calling Stop on Test leaks executor threads when concurrent download of resources is on
Calling Stop on Test leaks executor threads when concurrent download of resou...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.5.1
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-09-30 08:06 UTC by Philippe Mouawad
Modified: 2011-10-05 00:29 UTC (History)
1 user (show)



Attachments
Test Case (40.83 KB, application/octet-stream)
2011-09-30 08:06 UTC, Philippe Mouawad
Details
Fix to the issue (1.66 KB, patch)
2011-09-30 08:09 UTC, Philippe Mouawad
Details | Diff
Fix to the issue (1.63 KB, patch)
2011-09-30 08:10 UTC, Philippe Mouawad
Details | Diff
Fix to issue (1.63 KB, patch)
2011-10-04 14:34 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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