Skip to content

Commit b936059

Browse files
authored
fix context bug (#4730)
* fix context bug Signed-off-by: xinyual <xinyual@amazon.com> * remove useless stash Signed-off-by: xinyual <xinyual@amazon.com> --------- Signed-off-by: xinyual <xinyual@amazon.com>
1 parent e5690af commit b936059

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

plugin/src/main/java/org/opensearch/ml/action/IndexInsight/GetIndexInsightTransportAction.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,7 @@ protected void doExecute(Task task, ActionRequest request, ActionListener<MLInde
129129
);
130130
return;
131131
}
132-
try (ThreadContext.StoredContext context = client.threadPool().getThreadContext().stashContext()) {
133-
ActionListener<MLIndexInsightGetResponse> wrappedListener = ActionListener
134-
.runBefore(actionListener, () -> context.restore());
135-
executeTaskAndReturn(
136-
mlIndexInsightGetRequest,
137-
mlIndexInsightGetRequest.getTenantId(),
138-
wrappedListener
139-
);
140-
} catch (Exception e) {
141-
log.error("Failed to get index insight", e);
142-
actionListener.onFailure(e);
143-
}
132+
executeTaskAndReturn(mlIndexInsightGetRequest, mlIndexInsightGetRequest.getTenantId(), actionListener);
144133
} catch (Exception e) {
145134
actionListener.onFailure(e);
146135
}

0 commit comments

Comments
 (0)