**Build scan:**
https://gradle-enterprise.elastic.co/s/hh6sxuuncdapc/tests/:qa:rolling-upgrade:v7.17.10%23twoThirdsUpgradedTest/org.elasticsearch.upgrades.RecoveryIT/testRecoveryWithConcurrentIndexing

**Reproduction line:**
```
gradlew ':qa:rolling-upgrade:v7.17.10#twoThirdsUpgradedTest' -Dtests.class="org.elasticsearch.upgrades.RecoveryIT" -Dtests.method="testRecoveryWithConcurrentIndexing" -Dtests.seed=C0F8E6E3C9F4C07A -Dtests.bwc=true -Dtests.locale=it-CH -Dtests.timezone=America/Hermosillo -Druntime.java=19
```

**Applicable branches:**
8.6

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

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.upgrades.RecoveryIT&tests.test=testRecoveryWithConcurrentIndexing

**Failure excerpt:**
```
org.elasticsearch.client.WarningFailureException: method [PUT], host [http://127.0.0.1:62954], URI [/recovery_with_concurrent_indexing/_settings], status line [HTTP/1.1 200 OK]
Warnings: [[index.indexing.slowlog.level] setting was deprecated in the previous Elasticsearch release and is removed in this release.]
{"acknowledged":true}

  at __randomizedtesting.SeedInfo.seed([C0F8E6E3C9F4C07A:40A922B04B501EB0]:0)
  at org.elasticsearch.client.RestClient.convertResponse(RestClient.java:343)
  at org.elasticsearch.client.RestClient.performRequest(RestClient.java:313)
  at org.elasticsearch.client.RestClient.performRequest(RestClient.java:288)
  at org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1609)
  at org.elasticsearch.test.rest.ESRestTestCase.updateIndexSettings(ESRestTestCase.java:1603)
  at org.elasticsearch.upgrades.RecoveryIT.testRecoveryWithConcurrentIndexing(RecoveryIT.java:153)
  at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
  at java.lang.reflect.Method.invoke(Method.java:578)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
  at com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
  at com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
  at org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
  at org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
  at org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
  at org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
  at com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
  at com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
  at java.lang.Thread.run(Thread.java:1589)

```
server/src/test/java/org/elasticsearch/cluster/routing/allocation/allocator/AllocationActionMultiListenerTests.java
assertThat(completed.get(), equalTo(false));
    }
    public void testShouldDelegateFailureImmediately() {
        var listener = new AllocationActionMultiListener<AcknowledgedResponse>(createEmptyThreadContext());
        var completed = new AtomicBoolean(false);
        listener.delay(
            ActionListener.wrap(ignore -> { throw new AssertionError("Should not complete in test"); }, exception -> completed.set(true))
        ).onFailure(new RuntimeException());
        assertThat(completed.get(), equalTo(true));
    }
    public void testConcurrency() throws InterruptedException {
        var listener = new AllocationActionMultiListener<AcknowledgedResponse>(createEmptyThreadContext());
        var count = randomIntBetween(1, 100);
        var completed = new CountDownLatch(count);
        var start = new CountDownLatch(3);
        var threadPool = new TestThreadPool(getTestName());
        threadPool.executor(ThreadPool.Names.CLUSTER_COORDINATION).submit(() -> {
            start.countDown();
            awaitQuietly(start);
            for (int i = 0; i < count; i++) {
                listener.delay(
                    ActionListener.wrap(
                        ignore -> completed.countDown(),
                        exception -> { throw new AssertionError("Should not fail in test"); }
                    )
                ).onResponse(AcknowledgedResponse.TRUE);
            }
        });
        threadPool.executor(ThreadPool.Names.GENERIC).submit(() -> {
            start.countDown();