You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/29 03:12:32 UTC

[GitHub] [dubbo] killermyth opened a new issue, #10236: the magic in RpcContext.getContext().asyncCall()

killermyth opened a new issue, #10236:
URL: https://github.com/apache/dubbo/issues/10236

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ## Ask your question here
   when i use RpcContext.getContext().asyncCall() like below
   
          **RpcContext.getContext().asyncCall(() -> userListService.inList(param))
                   .handle((v, t) -> {
                       if (Objects.isNull(t)) {
                           log.info("inListAsync param {} result {}", JSON.toJSONString(param), v);
                           return v;
                       } else {
                           log.error("inListAsyncError param {} result {}", JSON.toJSONString(param), JSON.toJSONString(v), t);
                       }
                       return false;
                   });**
   
   the userListService definition is 
   **boolean inList(UserListParam param);**
   
   when i log in provider server i see server return true,but when i log in consumer server i see i got false
   I don't know what happened here, so appreciate if someone can help 。
   


-- 
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.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


[GitHub] [dubbo] killermyth commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
killermyth commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169502168

   > 
   
   thank you very much,but now upgrade for me is too expensive,may be later
   I don't know if the inList service return primitive data type trigger this question


-- 
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


[GitHub] [dubbo] killermyth commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
killermyth commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169878132

   > 2.8.5 is dubbox. Dubbox is no longer maintained. Please upgrade to Apache Dubbo.
   
   sorry my fault not 2.8.5 


-- 
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


[GitHub] [dubbo] killermyth commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
killermyth commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169505537

       boolean inList(UserListParam param);
   
       Boolean inListNew(UserListParam param);
   
   when i user inList error happened
   and user  inListNew everything is right 


-- 
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


[GitHub] [dubbo] killermyth commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
killermyth commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169489091

   And my dubbo version is 2.8.5


-- 
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


[GitHub] [dubbo] AlbumenJ commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169495256

   2.8.5 is dubbox. Dubbox is no longer maintained. Please upgrade to Apache Dubbo.


-- 
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


[GitHub] [dubbo] killermyth commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
killermyth commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169874680

   here is why
   when i jad the service code on consumer  i found somthing different
   
       public boolean inList(UserListParam userListParam) {
           Object[] objectArray = new Object[]{userListParam};
           Object object = this.handler.invoke(this, methods[0], objectArray);
           return object == null ? false : (Boolean)object;
       }
   
   the magic here is when you return boolean in your provider service and you call it with RpcContext.getContext().asyncCall(). You will always get false!!
   let's see why it happens.
   
   The code in RpcContext.getContext().asyncCall() is
   
                   final T o = callable.call();
                   //local invoke will return directly
                   if (o != null) {
                       if (o instanceof CompletableFuture) {
                           return (CompletableFuture<T>) o;
                       }
                       return CompletableFuture.completedFuture(o);
                   } else {
                       // The service has a normal sync method signature, should get future from RpcContext.
                   }
   
   Your code get result when callable.call() end so return first
   That's all
   


-- 
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


[GitHub] [dubbo] AlbumenJ commented on issue #10236: the magic in RpcContext.getContext().asyncCall()

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10236:
URL: https://github.com/apache/dubbo/issues/10236#issuecomment-1169596653

   You can set a breakpoint in `inList` to see what result return and how it processed before callback. 


-- 
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