1414import org .elasticsearch .action .bulk .BulkResponse ;
1515import org .elasticsearch .action .support .WriteRequest ;
1616import org .elasticsearch .client .internal .Client ;
17+ import org .elasticsearch .cluster .metadata .IndexMetadata ;
18+ import org .elasticsearch .cluster .routing .allocation .decider .EnableAllocationDecider ;
1719import org .elasticsearch .common .settings .Settings ;
1820import org .elasticsearch .common .util .concurrent .EsRejectedExecutionException ;
1921import org .elasticsearch .common .util .concurrent .EsThreadPoolExecutor ;
2022import org .elasticsearch .index .IndexingPressure ;
2123import org .elasticsearch .index .query .QueryBuilders ;
2224import org .elasticsearch .plugins .Plugin ;
2325import org .elasticsearch .test .ESIntegTestCase ;
24- import org .elasticsearch .test .junit .annotations .TestLogging ;
2526import org .elasticsearch .threadpool .ThreadPool ;
2627import org .elasticsearch .threadpool .ThreadPoolStats ;
2728
4647 * threads that wait on a phaser. This lets us verify that operations on system indices
4748 * are being directed to other thread pools.</p>
4849 */
49- @ TestLogging (
50- reason = "investigate" ,
51- value = "org.elasticsearch.kibana.KibanaThreadPoolIT:DEBUG,org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor:TRACE"
52- )
5350public class KibanaThreadPoolIT extends ESIntegTestCase {
5451 private static final Logger logger = LogManager .getLogger (KibanaThreadPoolIT .class );
5552
@@ -65,6 +62,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
6562 .put ("thread_pool.write.queue_size" , 1 )
6663 .put ("thread_pool.get.size" , 1 )
6764 .put ("thread_pool.get.queue_size" , 1 )
65+ // a rejected GET may retry on an INITIALIZING shard (the target of a relocation) and unexpectedly succeed, so block rebalancing
66+ .put (EnableAllocationDecider .CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING .getKey (), EnableAllocationDecider .Rebalance .NONE )
6867 .build ();
6968 }
7069
@@ -109,7 +108,12 @@ public void testKibanaThreadPoolByPassesBlockedThreadPools() throws Exception {
109108 }
110109
111110 public void testBlockedThreadPoolsRejectUserRequests () throws Exception {
112- assertAcked (client ().admin ().indices ().prepareCreate (USER_INDEX ));
111+ assertAcked (
112+ client ().admin ()
113+ .indices ()
114+ .prepareCreate (USER_INDEX )
115+ .setSettings (Settings .builder ().put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 )) // avoid retrying rejected actions
116+ );
113117
114118 runWithBlockedThreadPools (this ::assertThreadPoolsBlocked );
115119
0 commit comments