MaxChen1123 commented on code in PR #15192:
URL: https://github.com/apache/dubbo/pull/15192#discussion_r1990586443
##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java:
##########
@@ -81,6 +82,16 @@ public AsyncRpcResult(CompletableFuture<AppResponse> future,
Invocation invocati
&& !future.isDone()) {
async = true;
this.storedContext = RpcContext.clearAndStoreContext();
+
+ // this is to fix https://github.com/apache/dubbo/issues/13666
+ this.responseFuture = this.responseFuture.thenApply((appResponse)
-> {
+ RestoreContext tempStoredContext =
RpcContext.clearAndStoreContext();
+ this.storedContext.restore();
Review Comment:
Should we just get the `serverResponseLocal` in `storedContext` directly? Or
maybe we can have a flag in the RpcContext, once the user pass context into a
thread, they should manually set this flag to true, then we will check the flag
to decide whether add this `thenApply` or not. I'm not sure which one is
better. @AlbumenJ
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]