smalllazypig / solrmeter

Automatically exported from code.google.com/p/solrmeter
0 stars 0 forks source link

Scheduling bug in ConstantOperationExecutorThread.java (with patch) #95

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Using the constant executor, try to exceed 1000 queries per minute.  

What is the expected output? What do you see instead?
I expect to be able to exceed 1000 queries per minute.  Instead, it doesn't go 
beyond around 500.

What version of the product are you using? On what operating system?
Using svn trunk, revision 283, on a mac

Please provide any additional information below.
This is happening because of a bug in ConstantOperationExecutorThread.java.  
The executeOperation() method calls Thread.run() instead of Thread.start(), 
resulting in a "fixed delay" style scheduling rather than "fixed period" 
scheduling, meaning that actual queries per minute will never exceed 1 / 
(latency in minutes).  What's more, it should be using a thread pool that can 
recycle threads instead of creating a new one every time.  I have a patch with 
just such a fix.  See attachment.  

Original issue reported on code.google.com by black.ru...@gmail.com on 17 Jan 2012 at 5:59

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting the bug! Looks like it's a big one. Will take a look at it 
later.

Original comment by juan.gra...@gmail.com on 17 Jan 2012 at 6:09

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r285.

Original comment by tflo...@gmail.com on 19 Jan 2012 at 11:28

GoogleCodeExporter commented 9 years ago
Thanks for finding and fixing this issue! I just committed it to the trunk

Original comment by tflo...@gmail.com on 19 Jan 2012 at 11:29