Bug 52296 - TransactionController + Children ThrouputController or InterleaveController leads to ERROR sampleEnd called twice java.lang.Throwable: Invalid call sequence when TPC does not run sample
TransactionController + Children ThrouputController or InterleaveController l...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.5.1
All All
: P2 major (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-12-06 21:18 UTC by Philippe Mouawad
Modified: 2011-12-08 18:03 UTC (History)
1 user (show)



Attachments
Test plan to reproduce issue (15.15 KB, application/octet-stream)
2011-12-06 21:18 UTC, Philippe Mouawad
Details
Much simpler Test Plan (5.54 KB, application/octet-stream)
2011-12-06 21:28 UTC, Philippe Mouawad
Details
Test case where issue is always reproduced (5.54 KB, application/octet-stream)
2011-12-06 21:57 UTC, Philippe Mouawad
Details
Test plan to reproduce (16.57 KB, application/xml)
2011-12-07 19:13 UTC, Philippe Mouawad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Mouawad 2011-12-06 21:18:24 UTC
Created attachment 28043 [details]
Test plan to reproduce issue

Running the attached Test Plan (I simplified by replacing HTTP Sampler by Debug Sampler), I get the following message:
2011/12/06 22:13:53 WARN  - jmeter.control.TransactionController: Could not fetch SamplePackage 
2011/12/06 22:13:53 ERROR - jmeter.samplers.SampleResult: sampleEnd called twice java.lang.Throwable: Invalid call sequence
	at org.apache.jmeter.samplers.SampleResult.sampleEnd(SampleResult.java:985)
	at org.apache.jmeter.control.TransactionController.next2(TransactionController.java:177)
	at org.apache.jmeter.control.TransactionController.next(TransactionController.java:101)
	at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:195)
	at org.apache.jmeter.control.TransactionController.nextIsAController(TransactionController.java:139)
	at org.apache.jmeter.control.GenericController.next(GenericController.java:148)
	at org.apache.jmeter.control.TransactionController.next2(TransactionController.java:171)
	at org.apache.jmeter.control.TransactionController.next(TransactionController.java:101)
	at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:195)
	at org.apache.jmeter.control.TransactionController.nextIsAController(TransactionController.java:139)
	at org.apache.jmeter.control.GenericController.next(GenericController.java:148)
	at org.apache.jmeter.control.TransactionController.next2(TransactionController.java:171)
	at org.apache.jmeter.control.TransactionController.next(TransactionController.java:101)
	at org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:186)
	at org.apache.jmeter.control.GenericController.next(GenericController.java:148)
	at org.apache.jmeter.control.LoopController.next(LoopController.java:108)
	at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:75)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268)
	at java.lang.Thread.run(Thread.java:680)


Issue occurs on 2.5.1 , 2.5 and 2.4.
Comment 1 Philippe Mouawad 2011-12-06 21:28:31 UTC
Created attachment 28044 [details]
Much simpler Test Plan
Comment 2 Philippe Mouawad 2011-12-06 21:57:24 UTC
Created attachment 28045 [details]
Test case where issue is always reproduced

In fact, issue occurs when Throughput Controller decides not to run sample.

So I created Test Plan where %  is equal to 0 with one user and one iteration to simplify analysis.
Comment 3 Philippe Mouawad 2011-12-06 22:08:49 UTC
Issue is due to the fact that when TPC decides to execute NO sampler, in next2 method of TransactionSampler:
Sampler returnValue = super.next();
returnValue will be null so TransactionSampler thinks it has reached end of Controller so it executes sampleEnd, then next time when it has really reached end of controller we get  the error.
Comment 4 Philippe Mouawad 2011-12-06 22:29:53 UTC
Date: Tue Dec  6 22:28:51 2011
New Revision: 1211209

URL: http://svn.apache.org/viewvc?rev=1211209&view=rev
Log:
Bug 52296 - Getting ERROR sampleEnd called twice java.lang.Throwable: Invalid call sequence

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
   jmeter/trunk/xdocs/changes.xml
Comment 5 Philippe Mouawad 2011-12-06 22:34:45 UTC
Date: Tue Dec  6 22:34:05 2011
New Revision: 1211212

URL: http://svn.apache.org/viewvc?rev=1211212&view=rev
Log:
Bug 52296 - Getting ERROR sampleEnd called twice java.lang.Throwable: Invalid call sequence
Bug 52296 - TransactionController with Child ThrouputController : Getting ERROR sampleEnd called twice java.lang.Throwable: Invalid call sequence when TPC does not run sample

Renamed issue
Comment 6 Philippe Mouawad 2011-12-07 19:13:18 UTC
Created attachment 28051 [details]
Test plan to reproduce
Comment 7 Philippe Mouawad 2011-12-07 19:56:35 UTC
Issue is still here if TransactionSampler contains Controllers that may or may not execute sampler and in case of TPC if the total is not equal to 100%
Comment 8 Philippe Mouawad 2011-12-07 21:54:56 UTC
Date: Wed Dec  7 21:52:39 2011
New Revision: 1211656

URL: http://svn.apache.org/viewvc?rev=1211656&view=rev
Log:
Bug 52296 - TransactionController with Child ThrouputController : Getting ERROR sampleEnd called twice java.lang.Throwable: Invalid call sequence when TPC does not run sample

Modified:
   jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
   jmeter/trunk/xdocs/changes.xml
Comment 9 Philippe Mouawad 2011-12-08 18:03:27 UTC
Issue affects TransactionController that have one or more children of type:
- InterleaveController and subclasses
- IfController
- ThroughputController

Where one of the children Controllers does not execute every time.