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/07/01 00:51:20 UTC
[GitHub] [dubbo] yyykf opened a new pull request, #10248: [2.7] Fix async call issues
yyykf opened a new pull request, #10248:
URL: https://github.com/apache/dubbo/pull/10248
## What is the purpose of the change
fix #10236 , asyncCall should not return a completed Future when protocol is not injvm.
when return type of method is primitive type, the proxy will convert null to default value of primitive type. It will cause user get wrong result.
## Brief changelog
## Verifying this change
<!-- Follow this checklist to help us incorporate your contribution quickly and easily: -->
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Add some description to [dubbo-website](https://github.com/apache/dubbo-website) project if you are requesting to add a feature.
- [ ] GitHub Actions works fine on your own branch.
- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide).
--
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 a diff in pull request #10248: [2.7] Fix async call issues
Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10248:
URL: https://github.com/apache/dubbo/pull/10248#discussion_r911589226
##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcContext.java:
##########
@@ -732,7 +732,11 @@ public <T> CompletableFuture<T> asyncCall(Callable<T> callable) {
if (o instanceof CompletableFuture) {
return (CompletableFuture<T>) o;
}
- return CompletableFuture.completedFuture(o);
+ // not only local invoke will return directly, when return type of method is primitive type,
+ // the proxy will convert null to default value of primitive type. therefore, should not return a completed Future when protocol is not injvm
+ if (Constants.LOCAL_PROTOCOL.equals(url.getProtocol())) {
+ return CompletableFuture.completedFuture(o);
+ }
Review Comment:
If use async call invoke a local service without remote call, this will break the result
##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcContext.java:
##########
@@ -732,7 +732,11 @@ public <T> CompletableFuture<T> asyncCall(Callable<T> callable) {
if (o instanceof CompletableFuture) {
return (CompletableFuture<T>) o;
}
- return CompletableFuture.completedFuture(o);
+ // not only local invoke will return directly, when return type of method is primitive type,
+ // the proxy will convert null to default value of primitive type. therefore, should not return a completed Future when protocol is not injvm
+ if (Constants.LOCAL_PROTOCOL.equals(url.getProtocol())) {
Review Comment:
url here might not reliable
--
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] codecov-commenter commented on pull request #10248: [2.7] Fix async call issues
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10248:
URL: https://github.com/apache/dubbo/pull/10248#issuecomment-1171827001
# [Codecov](https://codecov.io/gh/apache/dubbo/pull/10248?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#10248](https://codecov.io/gh/apache/dubbo/pull/10248?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (dcc6391) into [master](https://codecov.io/gh/apache/dubbo/commit/f931f2f630bb17c3ea36a2aedcf9658b13eca611?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f931f2f) will **decrease** coverage by `0.29%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #10248 +/- ##
============================================
- Coverage 60.90% 60.60% -0.30%
+ Complexity 448 447 -1
============================================
Files 1100 1100
Lines 44579 44465 -114
Branches 6492 6455 -37
============================================
- Hits 27149 26949 -200
- Misses 14459 14548 +89
+ Partials 2971 2968 -3
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/10248?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...src/main/java/org/apache/dubbo/rpc/RpcContext.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9ScGNDb250ZXh0LmphdmE=) | `69.95% <100.00%> (+3.11%)` | :arrow_up: |
| [...a/org/apache/dubbo/rpc/filter/AccessLogFilter.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvQWNjZXNzTG9nRmlsdGVyLmphdmE=) | `27.69% <0.00%> (-50.77%)` | :arrow_down: |
| [...va/org/apache/dubbo/rpc/support/AccessLogData.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9zdXBwb3J0L0FjY2Vzc0xvZ0RhdGEuamF2YQ==) | `53.16% <0.00%> (-37.98%)` | :arrow_down: |
| [...ng/transport/dispatcher/all/AllChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9hbGwvQWxsQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `62.06% <0.00%> (-20.69%)` | :arrow_down: |
| [...rg/apache/dubbo/remoting/utils/PayloadDropper.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy91dGlscy9QYXlsb2FkRHJvcHBlci5qYXZh) | `76.92% <0.00%> (-15.39%)` | :arrow_down: |
| [...ng/transport/dispatcher/WrappedChannelHandler.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9XcmFwcGVkQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `47.82% <0.00%> (-15.22%)` | :arrow_down: |
| [...org/apache/dubbo/registry/dubbo/DubboRegistry.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktZGVmYXVsdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcmVnaXN0cnkvZHViYm8vRHViYm9SZWdpc3RyeS5qYXZh) | `42.00% <0.00%> (-14.00%)` | :arrow_down: |
| [...bo/config/event/listener/LoggingEventListener.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9ldmVudC9saXN0ZW5lci9Mb2dnaW5nRXZlbnRMaXN0ZW5lci5qYXZh) | `50.00% <0.00%> (-12.50%)` | :arrow_down: |
| [...dubbo/common/status/support/LoadStatusChecker.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vc3RhdHVzL3N1cHBvcnQvTG9hZFN0YXR1c0NoZWNrZXIuamF2YQ==) | `50.00% <0.00%> (-11.54%)` | :arrow_down: |
| [...in/java/org/apache/dubbo/common/utils/JVMUtil.java](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdXRpbHMvSlZNVXRpbC5qYXZh) | `81.13% <0.00%> (-11.33%)` | :arrow_down: |
| ... and [69 more](https://codecov.io/gh/apache/dubbo/pull/10248/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/10248?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/10248?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f931f2f...dcc6391](https://codecov.io/gh/apache/dubbo/pull/10248?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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] yyykf closed pull request #10248: [2.7] Fix async call issues
Posted by GitBox <gi...@apache.org>.
yyykf closed pull request #10248: [2.7] Fix async call issues
URL: https://github.com/apache/dubbo/pull/10248
--
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