You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AlbumenJ (via GitHub)" <gi...@apache.org> on 2023/06/18 05:35:57 UTC

[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #12534: Clear future in RpcContext when calling sync (#12493)

AlbumenJ commented on code in PR #12534:
URL: https://github.com/apache/dubbo/pull/12534#discussion_r1233198493


##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java:
##########
@@ -219,6 +219,8 @@ public Result whenCompleteWithContext(BiConsumer<Result, Throwable> fn) {
         if (setFutureWhenSync || ((RpcInvocation) invocation).getInvokeMode() != InvokeMode.SYNC) {
             // Necessary! update future in context, see https://github.com/apache/dubbo/issues/9461
             RpcContext.getServiceContext().setFuture(new FutureAdapter<>(this.responseFuture));
+        } else {
+            FutureContext.getContext().clearFuture();

Review Comment:
   Clear here might not a good idea. It would be better to skip set in advance.



-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org