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.
server/src/main/java/org/elasticsearch/indices/recovery/RecoveryTarget.java
private final Logger logger;
    private static final AtomicLong idGenerator = new AtomicLong();
    private static final String RECOVERY_PREFIX = "recovery.";
    private final ShardId shardId;
    private final long recoveryId;
    private final IndexShard indexShard;
    private final DiscoveryNode sourceNode;
    private final SnapshotFilesProvider snapshotFilesProvider;
    private volatile MultiFileWriter multiFileWriter;
    private final RecoveryRequestTracker requestTracker = new RecoveryRequestTracker();
    private final Store store;
    private final PeerRecoveryTargetService.RecoveryListener listener;
    private final AtomicBoolean finished = new AtomicBoolean();
    private final CancellableThreads cancellableThreads;
    
    private volatile long lastAccessTime = System.nanoTime();
    private final AtomicInteger recoveryMonitorBlocks = new AtomicInteger();
    @Nullable 
    private volatile Releasable snapshotFileDownloadsPermit;
    
    private final CountDownLatch closedLatch = new CountDownLatch(1);
    /**