Skip to content

Commit d897cc3

Browse files
committed
Fix MasterService to execute tasks in the context in which the task was originally created.
MasterService used to execute tasks in a completely empty context rather than the original context which was captured when the task was created. Fixes #108628 (DeprecationHttpIT.testDeprecatedSettingsReturnWarnings)
1 parent d67d13c commit d897cc3

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ tests:
6666
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
6767
method: test {p0=transform/transforms_start_stop/Test start already started transform}
6868
issue: https://github.com/elastic/elasticsearch/issues/98802
69-
- class: org.elasticsearch.xpack.deprecation.DeprecationHttpIT
70-
method: testDeprecatedSettingsReturnWarnings
71-
issue: https://github.com/elastic/elasticsearch/issues/108628
7269
- class: org.elasticsearch.xpack.shutdown.NodeShutdownIT
7370
method: testAllocationPreventedForRemoval
7471
issue: https://github.com/elastic/elasticsearch/issues/116363

server/src/main/java/org/elasticsearch/cluster/service/MasterService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ public void onFailure(Exception failure) {
913913

914914
@Override
915915
public Releasable captureResponseHeaders() {
916-
final var storedContext = threadContext.newStoredContext();
916+
final var storedContext = threadContextSupplier.get();
917917
return Releasables.wrap(() -> {
918918
final var newResponseHeaders = threadContext.getResponseHeaders();
919919
if (newResponseHeaders.isEmpty()) {

0 commit comments

Comments
 (0)