Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于2.7.0版本中DubboInvoker.doInvoke方法疑问 #4421

Closed
thisiswanghy opened this issue Jun 28, 2019 · 2 comments
Closed

关于2.7.0版本中DubboInvoker.doInvoke方法疑问 #4421

thisiswanghy opened this issue Jun 28, 2019 · 2 comments

Comments

@thisiswanghy
Copy link
Contributor

在dubbo 2.7.0版本中DubboInvoker.doInvoke方法第99行到104行,根据isAsyncFuture是否为true,决定调用的是AsyncRpcResult的构造方法还是SimpleAsyncRpcResult的构造方法。且调用参数完全一致。而SimpleAsyncRpcResult继承自AsyncRpcResult,其构造方法调用父类的构造方法。

也就是说这个isAsyncFuture的判断是没有意义的。而且根据相关逻辑和DubboInvoker第100行的注释,
register resultCallback, sometimes we need the async result being processed by the filter chain.
第101行,即
result = new AsyncRpcResult(futureAdapter, futureAdapter.getResultFuture(), false);
应该为
result = new AsyncRpcResult(futureAdapter, futureAdapter.getResultFuture(), true);

@wavesZh
Copy link
Contributor

wavesZh commented Jun 30, 2019

不应该仅看父类构造器,还要看看改变的方法。SimpleAsyncRpcResult #recreate()return null。可能是表示无返回值/不关注返回值的异步调用。

@lexburner
Copy link
Contributor

@thisiswanghy 看一下最新版本的代码吧,异步链这一块逻辑应该变更了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants