Skip to content

Commit

Permalink
Move markAsSystemContext
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks committed Nov 22, 2024
1 parent 83896cd commit 0ef49bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ protected <Request extends ActionRequest, Response extends ActionResponse> void
() -> in().threadPool().getThreadContext().stashWithOrigin(origin)
)
) {
ThreadContext threadContext = in().threadPool().getThreadContext();
ThreadContextAccess.doPrivilegedVoid(threadContext::markAsSystemContext);
super.doExecute(action, request, new ContextPreservingActionListener<>(supplier, listener));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public StoredContext stashWithOrigin(String origin) {
sm.checkPermission(STASH_WITH_ORIGIN_THREAD_CONTEXT_PERMISSION);
}
final ThreadContext.StoredContext storedContext = stashContext();
ThreadContextAccess.doPrivilegedVoid(this::markAsSystemContext);
putTransient(ACTION_ORIGIN_TRANSIENT_NAME, origin);
return storedContext;
}
Expand Down

0 comments on commit 0ef49bf

Please sign in to comment.