Summary: | The shutdown command is not working if I invoke it before all the thread are started | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Philippe Mouawad <p.mouawad> |
Component: | Main | Assignee: | 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: |
Fix to the issue
sample of shutdown problem with DummySample from jp@gc Fix to startScheduler Fix to startScheduler issue with last rev |
Description
Philippe Mouawad
2011-09-23 10:14:13 UTC
Created attachment 27575 [details]
Fix to the issue
Hello,
I reproduce your issue (not sure it's a new one).
In fact shutdown will succeed but only after initial rampup will have occured.
In current implementation, only stop was called without interruption of thread, so sleeping threads would be still blocked in sleep:
"Thread Group 1-23" prio=6 tid=101de3000 nid=0x125416000 waiting on condition [125415000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.jmeter.threads.JMeterThread.rampUpDelay(JMeterThread.java:750)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:491)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:245)
at java.lang.Thread.run(Thread.java:680)
So my fix calls interrupt on Thread to give a chance to sleep to exit.
Regards
Philippe Mouawad
Thanks. The patch may well work, but the point of Shutdown is to do so gracefully; i.e. allow threads to complete what they are doing. Generating an interrupt will cause problems for threads that have started. I'll look into this further. This was a side-effect of the fix for Bug 51839. URL: http://svn.apache.org/viewvc?rev=1174675&view=rev Log: Bug 51880 - The shutdown command is not working if I invoke it before all the thread are started. Modified: jakarta/jmeter/trunk/bin/jmeter.properties jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java jakarta/jmeter/trunk/xdocs/changes.xml Created attachment 27601 [details] sample of shutdown problem with DummySample from jp@gc Need to add JMeterPlugins.jar from http://code.google.com/p/jmeter-plugins/downloads/detail?name=JMeterPlugins-0.4.2.zip to lib/ext to open and run jmx. Hello, I added JMeterPlugins.jar to lib/ext and tried to load your plan I got: 2011/09/27 09:12:32 ERROR - jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup ---- Debugging information ---- message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup class : org.apache.jorphan.collections.ListedHashTree required-type : org.apache.jorphan.collections.ListedHashTree path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup line number : 14 ------------------------------- : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup ---- Debugging information ---- message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup class : org.apache.jorphan.collections.ListedHashTree required-type : org.apache.jorphan.collections.ListedHashTree path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup line number : 14 ------------------------------- message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup ---- Debugging information ---- message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup class : org.apache.jorphan.collections.ListedHashTree required-type : org.apache.jorphan.collections.ListedHashTree path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup line number : 14 ------------------------------- cause-exception : com.thoughtworks.xstream.converters.ConversionException cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup : kg.apc.jmeter.threads.SteppingThreadGroup first-jmeter-class : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:69) class : org.apache.jmeter.save.ScriptWrapper required-type : org.apache.jorphan.collections.ListedHashTree path : /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup line number : 14 ------------------------------- 2011/09/27 09:12:32 WARN - jmeter.gui.action.Load: Unexpected error java.lang.Exception: Error in TestPlan - see log file at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:155) at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:110) at org.apache.jmeter.gui.action.Load.doAction(Load.java:89) at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:82) at org.apache.jmeter.gui.action.ActionRouter.access$0(ActionRouter.java:67) at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:61) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677) at java.awt.EventQueue.access$000(EventQueue.java:85) at java.awt.EventQueue$1.run(EventQueue.java:638) at java.awt.EventQueue$1.run(EventQueue.java:636) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:647) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) Regards Philippe Mouawad (In reply to comment #5) > Hello, > I added JMeterPlugins.jar to lib/ext and tried to load your plan I got: > 2011/09/27 09:12:32 ERROR - jmeter.save.SaveService: Conversion error > com.thoughtworks.xstream.converters.ConversionException: > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > ---- Debugging information ---- > message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > cause-exception : > com.thoughtworks.xstream.mapper.CannotResolveClassException > cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > class : org.apache.jorphan.collections.ListedHashTree > required-type : org.apache.jorphan.collections.ListedHashTree > path : > /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup > line number : 14 > ------------------------------- : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > ---- Debugging information ---- > message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > cause-exception : > com.thoughtworks.xstream.mapper.CannotResolveClassException > cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > class : org.apache.jorphan.collections.ListedHashTree > required-type : org.apache.jorphan.collections.ListedHashTree > path : > /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup > line number : 14 > ------------------------------- > message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > ---- Debugging information ---- > message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > cause-exception : > com.thoughtworks.xstream.mapper.CannotResolveClassException > cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > class : org.apache.jorphan.collections.ListedHashTree > required-type : org.apache.jorphan.collections.ListedHashTree > path : > /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup > line number : 14 > ------------------------------- > cause-exception : com.thoughtworks.xstream.converters.ConversionException > cause-message : kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup : > kg.apc.jmeter.threads.SteppingThreadGroup > first-jmeter-class : > org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:69) > class : org.apache.jmeter.save.ScriptWrapper > required-type : org.apache.jorphan.collections.ListedHashTree > path : > /jmeterTestPlan/hashTree/hashTree/kg.apc.jmeter.threads.SteppingThreadGroup > line number : 14 > ------------------------------- > 2011/09/27 09:12:32 WARN - jmeter.gui.action.Load: Unexpected error > java.lang.Exception: Error in TestPlan - see log file > at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:155) > at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:110) > at org.apache.jmeter.gui.action.Load.doAction(Load.java:89) > at > org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:82) > at org.apache.jmeter.gui.action.ActionRouter.access$0(ActionRouter.java:67) > at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:61) > at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) > at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677) > at java.awt.EventQueue.access$000(EventQueue.java:85) > at java.awt.EventQueue$1.run(EventQueue.java:638) > at java.awt.EventQueue$1.run(EventQueue.java:636) > at java.security.AccessController.doPrivileged(Native Method) > at > java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) > at java.awt.EventQueue.dispatchEvent(EventQueue.java:647) > at > java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296) > at > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211) > at > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188) > at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) > > > Regards > Philippe Mouawad Forget about this, will take a cup of coffee to wakeup :-) Created attachment 27603 [details]
Fix to startScheduler
I reproduced bug.
Applied same fix method as Sebb did on rampUpDelay.
Thank you for your report.
If you have time to test patch would be nice.
Regards
Philippe Mouawad
(In reply to comment #7) > Created attachment 27603 [details] > Fix to startScheduler > > I reproduced bug. With which build of JMeter? > Applied same fix method as Sebb did on rampUpDelay. That fix has already been applied, and is in builds from r1174675 - see comment 3 > Thank you for your report. > If you have time to test patch would be nice. Please test against latest JMeter code - r1176077 is latest at present. (In reply to comment #8) > (In reply to comment #7) > > Created attachment 27603 [details] > > Fix to startScheduler > > > > I reproduced bug. > > With which build of JMeter? > > > Applied same fix method as Sebb did on rampUpDelay. > > That fix has already been applied, and is in builds from r1174675 - see comment > 3 > > > Thank you for your report. > > If you have time to test patch would be nice. > > Please test against latest JMeter code - r1176077 is latest at present. Hello Sebb, I tested issue on last trunk revision. No the fix has not been applied, you applied it on rampUpDelay method, here issue occurs on startScheduler, the patch I provided follows the fix you applied on rampUpDelay(). Regards Philippe Created attachment 27607 [details]
Fix to startScheduler issue with last rev
Hello Sebb,
Ok I understood why you were saying I didn't test on last rev.
I retested before applying attached patch, Shutdown doesn't end until startime does, I get this thread dump :
2011-09-27 11:36:18
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.1-b02-384 mixed mode):
"jp@gc - Stepping Thread Group 1-2" prio=6 tid=101919800 nid=0x121701000 waiting on condition [121700000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.jmeter.threads.JMeterThread.startScheduler(JMeterThread.java:213)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:499)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:252)
at java.lang.Thread.run(Thread.java:680)
"StandardJMeterEngine" prio=6 tid=103121000 nid=0x12011e000 in Object.wait() [12011d000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7a18089d8> (a java.lang.Thread)
at java.lang.Thread.join(Thread.java:1218)
- locked <7a18089d8> (a java.lang.Thread)
at org.apache.jmeter.engine.StandardJMeterEngine.waitThreadsStopped(StandardJMeterEngine.java:531)
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:434)
at java.lang.Thread.run(Thread.java:680)
After patch it is OK.
Regards
Philippe
Sorry, I see now. URL: http://svn.apache.org/viewvc?rev=1176299&view=rev Log: Bug 51880 - The shutdown command is not working if I invoke it before all the thread are started Part2 - fix to startUp delay (previous fix was to rampUp delay) Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java Does that look OK now to you? Ok for me, Stef is it Ok for you, you must get last hudson build on nightly build page (link at bottom) Regards Philippe (In reply to comment #12) > Ok for me, > Stef is it Ok for you, you must get last hudson build on nightly build page > (link at bottom) > > Regards > Philippe Hi Philippe, I tested it on r1176299, it works fine now. Thanks! Stef Sebb, I close issue since stef said it was also OK for him. This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2560 |