diff --git a/servlet-core/src/main/java/io/micronaut/servlet/http/ServletHttpHandler.java b/servlet-core/src/main/java/io/micronaut/servlet/http/ServletHttpHandler.java index 0d5807b0f..f8e9ed301 100644 --- a/servlet-core/src/main/java/io/micronaut/servlet/http/ServletHttpHandler.java +++ b/servlet-core/src/main/java/io/micronaut/servlet/http/ServletHttpHandler.java @@ -208,7 +208,7 @@ public void service(ServletExchange exchange) { if (exchange.getRequest().isAsyncSupported()) { exchange.getRequest().executeAsync(asyncExecution -> { - try (PropagatedContext.Scope ignore = PropagatedContext.newContext(new ServerHttpRequestContext(req)).propagate()) { + try (PropagatedContext.Scope ignore = PropagatedContext.getOrEmpty().plus(new ServerHttpRequestContext(req)).propagate()) { lc.handleNormal() .onComplete((response, throwable) -> onComplete(exchange, req, response, throwable, httpResponse -> { asyncExecution.complete(); @@ -217,7 +217,7 @@ public void service(ServletExchange exchange) { } }); } else { - try (PropagatedContext.Scope ignore = PropagatedContext.newContext(new ServerHttpRequestContext(req)).propagate()) { + try (PropagatedContext.Scope ignore = PropagatedContext.getOrEmpty().plus(new ServerHttpRequestContext(req)).propagate()) { CompletableFuture termination = new CompletableFuture<>(); lc.handleNormal() .onComplete((response, throwable) -> {