Skip to content

setOnreturn doesn't take effect in async generic invocation #208

Closed

Description

@rhion

原例子

Object xx =  s.$invoke("Test", t, p);

发现bug在FutureFilter.fireInvokeCallback的

final Method onInvokeMethod = (Method)StaticContext.getSystemContext().get(StaticContext.getKey(invoker.getUrl(), invocation.getMethodName(), Constants.ON_INVOKE_METHOD_KEY));

就是这个invocation.getMethodName() 这个值是$invoke 而不是Test
而StaticContext.getSystemContext()的key是用Test方法明作为key

Activity

  1. changed the title [-]异步泛华调用设置setOnreturn无效 2.5.3版本[/-] [+]异步泛化调用设置setOnreturn无效 2.5.3版本[/+] on Mar 1, 2016
  2. rhion commented on Mar 1, 2016

    @rhion
    Author

    准确定位就是invocation.getMethodName() 在异步时,设置出错。设置成了$invoke

  3. rhion commented on Apr 21, 2016

    @rhion
    Author

    dubbo.rpc模块
    hack修改过代码----------------
    StaticContext.java

    oldcode:line 62

    public static String getKey(URL url, String methodName, String suffix) {
        return getKey(url.getServiceKey(), methodName, suffix);
    }

    -------change to

    public static String getKey(URL url, String methodName, String suffix) {
        if("$invoke".equals(methodName)){
            methodName = url.getParameter("methods");
        }
        return getKey(url.getServiceKey(), methodName, suffix);
    } 

    这段代码比较丑陋写死$invoke,暂时可以解决问题。

  4. lihuagang03 commented on Dec 13, 2017

    @lihuagang03

    @chickenlj 异步泛化调用适用于API网关对接内部Dubbo应用,这个问题有更好的解法吗

  5. lihuagang03 commented on Mar 2, 2019

    @lihuagang03

    准确定位就是invocation.getMethodName() 在异步时,设置出错。设置成了$invoke

    我们遇到过这个问题,内部版本修复掉了,但忘记回馈给社区了,抱歉。

  6. added this to the 2.7.1 milestone on Mar 4, 2019
  7. changed the title [-]异步泛化调用设置setOnreturn无效 2.5.3版本[/-] [+]setOnreturn doesn't take effect in async generic invocation[/+] on Mar 14, 2019
  8. added a commit that references this issue on Mar 26, 2019
    897b80d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions