16
16
import org .elasticsearch .action .search .SearchRequest ;
17
17
import org .elasticsearch .action .support .WriteRequest ;
18
18
import org .elasticsearch .client .internal .Client ;
19
+ import org .elasticsearch .cluster .metadata .IndexMetadata ;
20
+ import org .elasticsearch .cluster .routing .allocation .decider .EnableAllocationDecider ;
19
21
import org .elasticsearch .common .settings .Settings ;
20
22
import org .elasticsearch .common .util .concurrent .EsRejectedExecutionException ;
21
23
import org .elasticsearch .common .util .concurrent .EsThreadPoolExecutor ;
22
24
import org .elasticsearch .index .IndexingPressure ;
23
25
import org .elasticsearch .index .query .QueryBuilders ;
24
26
import org .elasticsearch .plugins .Plugin ;
25
27
import org .elasticsearch .test .ESIntegTestCase ;
26
- import org .elasticsearch .test .junit .annotations .TestLogging ;
27
28
import org .elasticsearch .threadpool .ThreadPool ;
28
29
import org .elasticsearch .threadpool .ThreadPoolStats ;
29
30
49
50
* threads that wait on a phaser. This lets us verify that operations on system indices
50
51
* are being directed to other thread pools.</p>
51
52
*/
52
- @ TestLogging (
53
- reason = "investigate" ,
54
- value = "org.elasticsearch.kibana.KibanaThreadPoolIT:DEBUG,org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor:TRACE"
55
- )
56
53
public class KibanaThreadPoolIT extends ESIntegTestCase {
57
54
private static final Logger logger = LogManager .getLogger (KibanaThreadPoolIT .class );
58
55
@@ -68,6 +65,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
68
65
.put ("thread_pool.write.queue_size" , 1 )
69
66
.put ("thread_pool.get.size" , 1 )
70
67
.put ("thread_pool.get.queue_size" , 1 )
68
+ // a rejected GET may retry on an INITIALIZING shard (the target of a relocation) and unexpectedly succeed, so block rebalancing
69
+ .put (EnableAllocationDecider .CLUSTER_ROUTING_REBALANCE_ENABLE_SETTING .getKey (), EnableAllocationDecider .Rebalance .NONE )
71
70
.build ();
72
71
}
73
72
@@ -112,7 +111,12 @@ public void testKibanaThreadPoolByPassesBlockedThreadPools() throws Exception {
112
111
}
113
112
114
113
public void testBlockedThreadPoolsRejectUserRequests () throws Exception {
115
- assertAcked (client ().admin ().indices ().prepareCreate (USER_INDEX ));
114
+ assertAcked (
115
+ client ().admin ()
116
+ .indices ()
117
+ .prepareCreate (USER_INDEX )
118
+ .setSettings (Settings .builder ().put (IndexMetadata .SETTING_NUMBER_OF_REPLICAS , 0 )) // avoid retrying rejected actions
119
+ );
116
120
117
121
runWithBlockedThreadPools (this ::assertThreadPoolsBlocked );
118
122
0 commit comments