Instead we should use `org.elasticsearch.tasks.CancellableTask#addListener` to add a listener which sets `failure` on cancellation.
x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/RepositoryAnalyzeAction.java
() -> {},
                requestRefs::close
            );
        }
        private boolean rarely(Random random) {
            return random.nextDouble() < request.getRareActionProbability();
        }
        private Iterator<Consumer<Releasable>> getQueueIterator() {
            return new Iterator<>() {
                Consumer<Releasable> nextItem = queue.poll();
                @Override
                public boolean hasNext() {
                    return nextItem != null;
                }
                @Override
                public Consumer<Releasable> next() {
                    assert nextItem != null;
                    final var currentItem = nextItem;
                    nextItem = queue.poll();
                    return currentItem;
                }
            };
        }
        private void runBlobAnalysis(Releasable ref, final BlobAnalyzeAction.Request request, DiscoveryNode node) {
            if (isRunning()) {
                logger.trace("processing [{}] on [{}]", request, node);
                
                
                transportService.sendChildRequest(
                    node,