Skip to content

Commit 0349dc3

Browse files
committed
Update
Signed-off-by: Peng Huo <penghuo@gmail.com>
1 parent 022ea79 commit 0349dc3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

opensearch/src/main/java/org/opensearch/sql/opensearch/storage/scan/BackgroundSearchScanner.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ public SearchBatchResult fetchNextBatch(OpenSearchRequest request) {
172172

173173
// Pre-fetch next batch if needed
174174
if (!stopIteration && isAsync()) {
175+
ProfileContext ctx = QueryProfiling.current();
175176
nextBatchFuture =
176-
CompletableFuture.supplyAsync(() -> client.search(request), backgroundExecutor);
177+
CompletableFuture.supplyAsync(
178+
() -> QueryProfiling.withCurrentContext(ctx, () -> client.search(request)),
179+
backgroundExecutor);
177180
}
178181
} else {
179182
iterator = Collections.emptyIterator();

0 commit comments

Comments
 (0)