This failure seems related: https://gradle-enterprise.elastic.co/s/hbx32w3mmvsiu/tests/:server:internalClusterTest/org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT/testUnrestorableIndexDuringRestore?top-execution=1

**Build scan:**
https://gradle-enterprise.elastic.co/s/hbx32w3mmvsiu/tests/:server:internalClusterTest/org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT

**Reproduction line:**
```
./gradlew ':server:internalClusterTest' --tests "org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT" -Dtests.seed=52861D7778F38700 -Dtests.locale=en-US -Dtests.timezone=UTC -Druntime.java=20
```

**Applicable branches:**
main

**Reproduces locally?:**
No

**Failure history:**
https://gradle-enterprise.elastic.co/scans/tests?tests.container=org.elasticsearch.snapshots.SharedClusterSnapshotRestoreIT&tests.test=classMethod

**Failure excerpt:**
```
java.lang.Exception: Suite timeout exceeded (>= 1200000 msec).

  at __randomizedtesting.SeedInfo.seed([52861D7778F38700]:0)

```
server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreClusterStateListener.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.action.admin.cluster.snapshots.restore;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.cluster.ClusterChangedEvent;
import org.elasticsearch.cluster.ClusterStateListener;
import org.elasticsearch.cluster.RestoreInProgress;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.snapshots.RestoreInfo;
import org.elasticsearch.snapshots.RestoreService;
import java.util.Map;
import java.util.function.Supplier;
import static org.elasticsearch.snapshots.RestoreService.restoreInProgress;
public class RestoreClusterStateListener implements ClusterStateListener {
    private static final Logger logger = LogManager.getLogger(RestoreClusterStateListener.class);
    private final ClusterService clusterService;