Skip to content

Commit cfd1592

Browse files
committed
restore context
1 parent 818342f commit cfd1592

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/DataNodeComputeHandler.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ void startComputeOnDataNodes(
9898
Runnable runOnTaskFailure,
9999
ActionListener<ComputeResponse> outListener
100100
) {
101+
var storedContext = transportService.getThreadPool().getThreadContext().newStoredContext();
101102
new DataNodeRequestSender(
102103
transportService,
103104
esqlExecutor,
@@ -141,7 +142,7 @@ protected void sendRequest(
141142
final Runnable onGroupFailure;
142143
final CancellableTask groupTask;
143144
if (configuration.allowPartialResults()) {
144-
try {
145+
try (storedContext) {
145146
groupTask = computeService.createGroupTask(
146147
parentTask,
147148
() -> "compute group: data-node [" + node.getName() + "], " + shardIds + " [" + shardIds + "]"

0 commit comments

Comments
 (0)