Skip to content

Commit fbbd199

Browse files
committed
Remove another obviously-pointless fork
1 parent 492defb commit fbbd199

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/main/java/org/elasticsearch/snapshots/SnapshotsService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,8 +1455,7 @@ protected void doRun() {
14551455
final ListenableFuture<Metadata> metadataListener = new ListenableFuture<>();
14561456
final Repository repo = repositoriesService.repository(snapshot.getRepository());
14571457
if (entry.isClone()) {
1458-
// TODO no need to fork here any more, we're already on a SNAPSHOT thread
1459-
threadPool.executor(ThreadPool.Names.SNAPSHOT).execute(ActionRunnable.supply(metadataListener, () -> {
1458+
ActionListener.completeWith(metadataListener, () -> {
14601459
final Metadata existing = repo.getSnapshotGlobalMetadata(entry.source());
14611460
final Metadata.Builder metaBuilder = Metadata.builder(existing);
14621461
final Set<Index> existingIndices = new HashSet<>();
@@ -1478,7 +1477,7 @@ protected void doRun() {
14781477
);
14791478
metaBuilder.dataStreams(dataStreamsToCopy, dataStreamAliasesToCopy);
14801479
return metaBuilder.build();
1481-
}));
1480+
});
14821481
} else {
14831482
metadataListener.onResponse(metadata);
14841483
}

0 commit comments

Comments
 (0)