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/08/14 08:39:09 UTC

[GitHub] [dubbo] liufeiyu1002 opened a new pull request, #10456: fxi GenericFilter 从 Attachment 中获取generic参数获取不到的问题

liufeiyu1002 opened a new pull request, #10456:
URL: https://github.com/apache/dubbo/pull/10456

   ## What is the purpose of the change
   
   
   
   ## 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 merged pull request #10456: fix GenericFilter 从 Attachment 中获取generic参数获取不到的问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ merged PR #10456:
URL: https://github.com/apache/dubbo/pull/10456


-- 
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 #10456: fxi GenericFilter 从 Attachment 中获取generic参数获取不到的问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on code in PR #10456:
URL: https://github.com/apache/dubbo/pull/10456#discussion_r945256748


##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/GenericFilter.java:
##########
@@ -97,7 +97,7 @@ public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
                 String generic = inv.getAttachment(GENERIC_KEY);
 
                 if (StringUtils.isBlank(generic)) {
-                    generic = RpcContext.getClientAttachment().getAttachment(GENERIC_KEY);
+                    generic = RpcContext.getServerAttachment().getAttachment(GENERIC_KEY);
                 }

Review Comment:
   这段逻辑应该是为了适配之前 http/hessian 协议的实现的,由于老的实现是直接用的 RpcContext.getContext().setAttachment(GENERIC_KEY, xxx) 来配置的,所以这个修改后会影响正常使用。最好这里是能有一个 fallback 的逻辑,从 invocation => server attachment => client attachment。



-- 
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] liufeiyu1002 commented on pull request #10456: fxi GenericFilter 从 Attachment 中获取generic参数获取不到的问题

Posted by GitBox <gi...@apache.org>.
liufeiyu1002 commented on PR #10456:
URL: https://github.com/apache/dubbo/pull/10456#issuecomment-1214312807

   ![image](https://user-images.githubusercontent.com/32605119/184529333-01fb58d1-63ce-43af-afce-3d72abfbe6f3.png)
   按照文档描述以及实际测试 此处应该通过  `RpcContext.getServerAttachment()` 获取 `Attachment` 参数


-- 
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] liufeiyu1002 commented on a diff in pull request #10456: fxi GenericFilter 从 Attachment 中获取generic参数获取不到的问题

Posted by GitBox <gi...@apache.org>.
liufeiyu1002 commented on code in PR #10456:
URL: https://github.com/apache/dubbo/pull/10456#discussion_r945258957


##########
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/GenericFilter.java:
##########
@@ -97,7 +97,7 @@ public Result invoke(Invoker<?> invoker, Invocation inv) throws RpcException {
                 String generic = inv.getAttachment(GENERIC_KEY);
 
                 if (StringUtils.isBlank(generic)) {
-                    generic = RpcContext.getClientAttachment().getAttachment(GENERIC_KEY);
+                    generic = RpcContext.getServerAttachment().getAttachment(GENERIC_KEY);
                 }

Review Comment:
   OK~



-- 
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 #10456: fxi GenericFilter 从 Attachment 中获取generic参数获取不到的问题

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10456:
URL: https://github.com/apache/dubbo/pull/10456#issuecomment-1214317230

   # [Codecov](https://codecov.io/gh/apache/dubbo/pull/10456?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 [#10456](https://codecov.io/gh/apache/dubbo/pull/10456?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1521278) into [3.1](https://codecov.io/gh/apache/dubbo/commit/29e4e4235b3dfdfdd4cd562bdc835bbd779634f4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (29e4e42) will **decrease** coverage by `0.25%`.
   > The diff coverage is `100.00%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##                3.1   #10456      +/-   ##
   ============================================
   - Coverage     65.51%   65.25%   -0.26%     
   - Complexity      295      317      +22     
   ============================================
     Files          1254     1254              
     Lines         54601    54569      -32     
     Branches       8256     8228      -28     
   ============================================
   - Hits          35770    35608     -162     
   - Misses        14947    15050     +103     
   - Partials       3884     3911      +27     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/10456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ava/org/apache/dubbo/rpc/filter/GenericFilter.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9maWx0ZXIvR2VuZXJpY0ZpbHRlci5qYXZh) | `26.01% <100.00%> (ø)` | |
   | [...dubbo/remoting/zookeeper/ZookeeperTransporter.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvWm9va2VlcGVyVHJhbnNwb3J0ZXIuamF2YQ==) | `50.00% <0.00%> (-33.34%)` | :arrow_down: |
   | [...ng/zookeeper/curator5/Curator5ZookeeperClient.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3Rpbmctem9va2VlcGVyLWN1cmF0b3I1L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy96b29rZWVwZXIvY3VyYXRvcjUvQ3VyYXRvcjVab29rZWVwZXJDbGllbnQuamF2YQ==) | `43.86% <0.00%> (-27.36%)` | :arrow_down: |
   | [...nt/metadata/ServiceInstanceHostPortCustomizer.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvbWV0YWRhdGEvU2VydmljZUluc3RhbmNlSG9zdFBvcnRDdXN0b21pemVyLmphdmE=) | `65.78% <0.00%> (-21.06%)` | :arrow_down: |
   | [...ache/dubbo/remoting/transport/AbstractChannel.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RDaGFubmVsLmphdmE=) | `75.00% <0.00%> (-12.50%)` | :arrow_down: |
   | [...che/dubbo/registry/client/NopServiceDiscovery.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9jbGllbnQvTm9wU2VydmljZURpc2NvdmVyeS5qYXZh) | `44.44% <0.00%> (-11.12%)` | :arrow_down: |
   | [...va/org/apache/dubbo/remoting/TimeoutException.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9UaW1lb3V0RXhjZXB0aW9uLmphdmE=) | `22.22% <0.00%> (-11.12%)` | :arrow_down: |
   | [...dubbo/common/status/support/LoadStatusChecker.java](https://codecov.io/gh/apache/dubbo/pull/10456/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==) | `58.33% <0.00%> (-8.34%)` | :arrow_down: |
   | [...dubbo/remoting/exchange/support/DefaultFuture.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L0RlZmF1bHRGdXR1cmUuamF2YQ==) | `80.35% <0.00%> (-7.58%)` | :arrow_down: |
   | [.../common/threadpool/serial/SerializingExecutor.java](https://codecov.io/gh/apache/dubbo/pull/10456/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-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdGhyZWFkcG9vbC9zZXJpYWwvU2VyaWFsaXppbmdFeGVjdXRvci5qYXZh) | `70.37% <0.00%> (-7.41%)` | :arrow_down: |
   | ... and [52 more](https://codecov.io/gh/apache/dubbo/pull/10456/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) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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