ASF Bugzilla – Attachment 27603 Details for
Bug 51880
The shutdown command is not working if I invoke it before all the thread are started
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix to startScheduler
BUG_51880-startScheduler.patch (text/plain), 1.33 KB, created by
Philippe Mouawad
on 2011-09-27 07:32:52 UTC
(
hide
)
Description:
Fix to startScheduler
Filename:
MIME Type:
Creator:
Philippe Mouawad
Created:
2011-09-27 07:32:52 UTC
Size:
1.33 KB
patch
obsolete
>Index: src/core/org/apache/jmeter/threads/JMeterThread.java >=================================================================== >--- src/core/org/apache/jmeter/threads/JMeterThread.java (revision 1176232) >+++ src/core/org/apache/jmeter/threads/JMeterThread.java (working copy) >@@ -209,9 +209,23 @@ > private void startScheduler() { > long delay = (startTime - System.currentTimeMillis()); > if (delay > 0) { >- try { >- Thread.sleep(delay); >- } catch (Exception e) { >+ long start = System.currentTimeMillis(); >+ long end = start + delay; >+ long now=0; >+ long pause = RAMPUP_GRANULARITY; >+ while(running && (now = System.currentTimeMillis()) < end) { >+ long togo = end - now; >+ if (togo < pause) { >+ pause = togo; >+ } >+ try { >+ Thread.sleep(pause); // delay between checks >+ } catch (InterruptedException e) { >+ if (running) { // Don't bother reporting stop test interruptions >+ log.warn("startScheduler delay for "+threadName+" was interrupted. Waited "+(now - start)+" milli-seconds out of "+delay); >+ } >+ break; >+ } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 51880
:
27575
|
27601
|
27603
|
27607