org.elasticsearch.indices.recovery.RecoveryTarget#restoreFileFromSnapshot does not check for cancellation during the download of a file. This means that if a recovery is cancelled mid-way, we will still not release the store/shard-lock until the file is fully downloaded.
For large files or slow downloads this can lead to problems when the shard is (re-)allocated to a node that is still executing such an interrupted recovery.

-> we need to add some checks for cancellation here like we have for other recovery modes.
x-pack/plugin/snapshot-based-recoveries/src/internalClusterTest/java/org/elasticsearch/xpack/snapshotbasedrecoveries/recovery/SnapshotBasedIndexRecoveryIT.java
new MockLogAppender.UnseenEventExpectation(
                        "expected no WARN logs",
                        RecoverySourceHandler.class.getName(),
                        Level.WARN,
                        "*"
                    )
                );
                assertAcked(client().admin().indices().prepareDelete(indexName).get());
                assertBusy(mockLogAppender::assertAllExpectationsMatched);
            } finally {
                Loggers.removeAppender(recoverySourceHandlerLogger, mockLogAppender);
                mockLogAppender.stop();
            }
            respondToRecoverSnapshotFile.countDown();
            assertThat(indexExists(indexName), is(equalTo(false)));
        } finally {
            updateSetting(INDICES_RECOVERY_MAX_CONCURRENT_SNAPSHOT_FILE_DOWNLOADS.getKey(), null);
        }
    }
    public void testRecoveryAfterRestoreUsesSnapshots() throws Exception {
        String indexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
        createIndex(
            indexName,
            indexSettings(1, 0).put(MergePolicyConfig.INDEX_MERGE_ENABLED, false)
                .put(IndexService.GLOBAL_CHECKPOINT_SYNC_INTERVAL_SETTING.getKey(), "1s")
                .build()
        );
        int numDocs = randomIntBetween(300, 1000);
        indexDocs(indexName, 0, numDocs);
        String repoName = "repo";