diff --git a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java index 847779c9066c4..695e96850e8e1 100644 --- a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java +++ b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBlobCacheService.java @@ -681,7 +681,7 @@ void populateAndRead( final List gaps = tracker.waitForRange( rangeToWrite, rangeToRead, - ActionListener.runBefore(listener, resource::close).delegateFailureAndWrap((l, success) -> { + ActionListener.runAfter(listener, resource::close).delegateFailureAndWrap((l, success) -> { var ioRef = io; assert regionOwners.get(ioRef) == this; final int start = Math.toIntExact(rangeToRead.start());