File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
main/java/org/elasticsearch/common/util/concurrent
test/java/org/elasticsearch/common/util/concurrent Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ public class EsThreadPoolExecutor extends ThreadPoolExecutor {
3131
3232 // noop probe to prevent starvation of work in the work queue due to ForceQueuePolicy
3333 // https://github.com/elastic/elasticsearch/issues/124667
34+ // note, this is intentionally not a lambda to avoid this ever be turned into a compile time constant
35+ // matching similar lambdas coming from other places
3436 static final Runnable WORKER_PROBE = new Runnable () {
3537 @ Override
3638 public void run () {}
Original file line number Diff line number Diff line change @@ -786,6 +786,40 @@ public void testScalingWithEmptyCoreAndKeepAlive() {
786786 );
787787 }
788788
789+ public void testScalingWithEmptyCoreAndLargerMaxSize () {
790+ // TODO currently the reproduction of the starvation bug does not work if max pool size > 1
791+ // https://github.com/elastic/elasticsearch/issues/124867
792+ testScalingWithEmptyCore (
793+ EsExecutors .newScaling (
794+ getTestName (),
795+ 0 ,
796+ between (2 , 5 ),
797+ 0 ,
798+ TimeUnit .MILLISECONDS ,
799+ true ,
800+ EsExecutors .daemonThreadFactory (getTestName ()),
801+ threadContext
802+ )
803+ );
804+ }
805+
806+ public void testScalingWithEmptyCoreAndKeepAliveAndLargerMaxSize () {
807+ // TODO currently the reproduction of the starvation bug does not work if max pool size > 1
808+ // https://github.com/elastic/elasticsearch/issues/124867
809+ testScalingWithEmptyCore (
810+ EsExecutors .newScaling (
811+ getTestName (),
812+ 0 ,
813+ between (2 , 5 ),
814+ 1 ,
815+ TimeUnit .MILLISECONDS ,
816+ true ,
817+ EsExecutors .daemonThreadFactory (getTestName ()),
818+ threadContext
819+ )
820+ );
821+ }
822+
789823 public void testScalingWithEmptyCoreAndWorkerPoolProbing () {
790824 // https://github.com/elastic/elasticsearch/issues/124667 is difficult to reproduce if max pool size > 1.
791825 // if probing mitigates the bug for max pool size = 1, we're good for larger pool sizes as well.
You can’t perform that action at this time.
0 commit comments