**Build scan:**
https://gradle-enterprise.elastic.co/s/qmkz55xcjp3qw/tests/:x-pack:plugin:esql:internalClusterTest/org.elasticsearch.xpack.esql.action.ManyShardsIT/testConcurrentQueries


**Reproduction line:**
```
./gradlew ':x-pack:plugin:esql:internalClusterTest' --tests "org.elasticsearch.xpack.esql.action.ManyShardsIT.testConcurrentQueries" -Dtests.seed=E5341DA56A124E35 -Dtests.locale=und -Dtests.timezone=America/Godthab -Druntime.java=17
```

**Applicable branches:**
8.11

**Reproduces locally?:**
Didn't try

**Failure history:**
[Failure dashboard for `org.elasticsearch.xpack.esql.action.ManyShardsIT#testConcurrentQueries`](https://es-delivery-stats.elastic.dev/app/dashboards#/view/dcec9e60-72ac-11ee-8f39-55975ded9e63?_g=(refreshInterval:(pause:!t,value:60000),time:(from:now-7d%2Fd,to:now))&_a=(controlGroupInput:(chainingSystem:HIERARCHICAL,controlStyle:twoLine,ignoreParentSettings:(ignoreFilters:!f,ignoreQuery:!f,ignoreTimerange:!f,ignoreValidations:!t),panels:('0c0c9cb8-ccd2-45c6-9b13-96bac4abc542':(explicitInput:(dataViewId:fbbdc689-be23-4b3d-8057-aa402e9ed0c5,enhancements:(),fieldName:task.keyword,grow:!t,id:'0c0c9cb8-ccd2-45c6-9b13-96bac4abc542',searchTechnique:wildcard,selectedOptions:!(),singleSelect:!t,title:'Gradle%20Task',width:medium),grow:!t,order:0,type:optionsListControl,width:small),'144933da-5c1b-4257-a969-7f43455a7901':(explicitInput:(dataViewId:fbbdc689-be23-4b3d-8057-aa402e9ed0c5,enhancements:(),fieldName:name.keyword,grow:!t,id:'144933da-5c1b-4257-a969-7f43455a7901',searchTechnique:wildcard,selectedOptions:!('testConcurrentQueries'),title:Test,width:medium),grow:!t,order:2,type:optionsListControl,width:medium),'4e6ad9d6-6fdc-4fcc-bf1a-aa6ca79e0850':(explicitInput:(dataViewId:fbbdc689-be23-4b3d-8057-aa402e9ed0c5,enhancements:(),fieldName:className.keyword,grow:!t,id:'4e6ad9d6-6fdc-4fcc-bf1a-aa6ca79e0850',searchTechnique:wildcard,selectedOptions:!('org.elasticsearch.xpack.esql.action.ManyShardsIT'),title:Suite,width:medium),grow:!t,order:1,type:optionsListControl,width:medium)))))


**Failure excerpt:**
```
com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=87, name=Thread-24, state=RUNNABLE, group=TGRP-ManyShardsIT]

  at __randomizedtesting.SeedInfo.seed([E5341DA56A124E35:A7AFFE80EA753B14]:0)

  Caused by: org.elasticsearch.common.util.concurrent.EsRejectedExecutionException: rejected execution of TimedRunnable{original=processing of [1485][indices:data/read/esql/compute]: org.elasticsearch.compute.operator.DriverTaskRunner$DriverRequest/zV9Lgz8lTT6s6HTfJnyT2w:616, creationTimeNanos=1077295067581, startTimeNanos=0, finishTimeNanos=-1, failedOrRejected=false} on TaskExecutionTimeTrackingEsThreadPoolExecutor[name = node_s0/esql, queue capacity = 1000, task execution EWMA = 1.7ms, total task execution time = 1.4s, org.elasticsearch.common.util.concurrent.TaskExecutionTimeTrackingEsThreadPoolExecutor@16067837[Running, pool size = 1, active threads = 1, queued tasks = 1000, completed tasks = 139]]

    at __randomizedtesting.SeedInfo.seed([E5341DA56A124E35]:0)
    at org.elasticsearch.common.util.concurrent.EsRejectedExecutionHandler.newRejectedException(EsRejectedExecutionHandler.java:40)
    at org.elasticsearch.common.util.concurrent.EsAbortPolicy.rejectedExecution(EsAbortPolicy.java:34)
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:833)
    at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1365)
    at org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor.execute(EsThreadPoolExecutor.java:72)
    at org.elasticsearch.transport.TransportService.sendLocalRequest(TransportService.java:1024)
    at org.elasticsearch.transport.TransportService$3.sendRequest(TransportService.java:142)
    at org.elasticsearch.transport.TransportService.sendRequestInternal(TransportService.java:951)
    at org.elasticsearch.transport.TransportService.sendRequest(TransportService.java:846)
    at org.elasticsearch.transport.TransportService.sendChildRequest(TransportService.java:910)
    at org.elasticsearch.transport.TransportService.sendChildRequest(TransportService.java:887)
    at org.elasticsearch.compute.operator.DriverTaskRunner$1.start(DriverTaskRunner.java:49)
    at org.elasticsearch.compute.operator.DriverRunner.runToCompletion(DriverRunner.java:90)
    at org.elasticsearch.compute.operator.DriverTaskRunner.executeDrivers(DriverTaskRunner.java:65)
    at org.elasticsearch.xpack.esql.plugin.ComputeService.runCompute(ComputeService.java:292)
    at org.elasticsearch.xpack.esql.plugin.ComputeService$DataNodeRequestHandler.lambda$messageReceived$5(ComputeService.java:458)
    at org.elasticsearch.action.ActionListener$2.onResponse(ActionListener.java:177)
    at org.elasticsearch.action.ActionListener.completeWith(ActionListener.java:305)
    at org.elasticsearch.xpack.esql.plugin.ComputeService.lambda$acquireSearchContexts$15(ComputeService.java:319)
    at org.elasticsearch.index.shard.IndexShard.ensureShardSearchActive(IndexShard.java:3932)
    at org.elasticsearch.xpack.esql.plugin.ComputeService.acquireSearchContexts(ComputeService.java:317)
    at org.elasticsearch.xpack.esql.plugin.ComputeService$DataNodeRequestHandler.messageReceived(ComputeService.java:456)
    at org.elasticsearch.xpack.esql.plugin.ComputeService$DataNodeRequestHandler.messageReceived(ComputeService.java:448)
    at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75)
    at org.elasticsearch.transport.InboundHandler.doHandleRequest(InboundHandler.java:288)
    at org.elasticsearch.transport.InboundHandler$1.doRun(InboundHandler.java:301)
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
    at org.elasticsearch.common.util.concurrent.TimedRunnable.doRun(TimedRunnable.java:33)
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:983)
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.lang.Thread.run(Thread.java:833)

```
x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/ManyShardsIT.java
}
            bulk.get();
        }
        int numQueries = between(10, 20);
        Thread[] threads = new Thread[numQueries];
        CountDownLatch latch = new CountDownLatch(1);
        for (int q = 0; q < numQueries; q++) {
            threads[q] = new Thread(() -> {
                try {
                    assertTrue(latch.await(1, TimeUnit.MINUTES));
                } catch (InterruptedException e) {
                    throw new AssertionError(e);
                }
                final var pragmas = Settings.builder();
                if (canUseQueryPragmas()) {
                    pragmas.put(randomPragmas().getSettings()).put("exchange_concurrent_clients", between(1, 2));
                }
                run("from test-* | stats count(user) by tags", new QueryPragmas(pragmas.build())).close();
            });
        }
        for (Thread thread : threads) {
            thread.start();
        }
        latch.countDown();
        for (Thread thread : threads) {
            thread.join();
        }
    }
}