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
Fix ClassCastException caused by 2.x's filter in some condition #12286
Conversation
dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/RpcResult.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Albumen Kevin <jhq0812@gmail.com>
…ainBuilder's invoke
@Override | ||
public org.apache.dubbo.rpc.Result whenCompleteWithContext(BiConsumer<org.apache.dubbo.rpc.Result, Throwable> fn) { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait a moment, I found when dubbo3 using dubbo2's Filter, RpcResult will be handle as AsyncRpcResult.
This function whenCompleteWithContext will be changed later, more code need to fix.
@wegod I have try to help you fix the test cases :) |
Codecov Report
@@ Coverage Diff @@
## 3.2 #12286 +/- ##
============================================
+ Coverage 69.35% 69.38% +0.03%
Complexity 2 2
============================================
Files 1606 1606
Lines 66229 66229
Branches 9718 9718
============================================
+ Hits 45932 45953 +21
+ Misses 15851 15831 -20
+ Partials 4446 4445 -1 see 32 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks very much. |
When DubboProtocol.CompletableFuture running result.thenApply and FilterChainBuilder.CallbackRegistrationInvoker running asyncResult.whenCompleteWithContext. All Result handle as AsyncRpcResult, so RpcResult add some methods implements seems like AsyncRpcResult does.
@AlbumenJ My test is done, I found new change in Filter.java and CompatibleResult.java that's better than my first code change. |
Kudos, SonarCloud Quality Gate passed! |
According to the roadmap, 3.1.x is only for security fix now. We can only maintian one branch due to limited working time (: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
All right. I'll upgrade to 3.2.x when it's stable. |
What is the purpose of the change
When upgrading from dubbo 2.x to 3.x, we have many projects and need to call provider service using 2.x filter and return RpcResult in some case.
So it's better to compatible of RpcResult when 3.x consumer calling 2.x provider
Brief changelog
Fix ClassCastException caused by 2.x's filter in some condition and compatible of RpcResult in dubbo version 2.x
Verifying this change
I test on my local env
Checklist