You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Philippe Mouawad <ph...@gmail.com> on 2012/07/08 15:25:21 UTC

BUG 53501

Hello,
I investigated this issue.
My idea to fix it is the following:

   - Add 2 new methods on AbstractThreadGroup:
      - public void start()  => Called when
      StandardJMeterEngine#startThreadGroup is called just before JMeterThread
      creation loop. It will notify AbstractThreadGroup that it is started
      - public void registerStartedThread(JMeterThread jmeterThread, Thread
      newThread) , which will be called just after Thread creation
      - public void stop(); => Called when stop or shutdown is called
      - Then in ThreadGroup, if scheduler mode is on , start will start a
   Timer that will execute on end of duration or at endTime. This timer will
   call on each JMeterThread of the Group:


   1. JMeterThread item = entry.getKey();
               item.stop(); // set stop flag
               item.interrupt(); // interrupt sampler if possible
               Thread t = entry.getValue();
               if (t != null ) { // Bug 49734
                   t.interrupt(); // also interrupt JVM thread
               }


   - I will also have to handle premature stops to cancel timerTask.



These changes will impact AbstractThreadGroup which is extended by Plugins
(JMETER Plugins @GC for example).  But for now they will just have to
recompile.

They will also have to call super.start() if they implement method in the
future.


It tried it and it fixes the issue but I wanted your ideas on impacts I may
not have foreseen.
Regards
Philippe