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

Fix forking npe #9613

Merged
merged 3 commits into from Mar 15, 2022
Merged

Fix forking npe #9613

merged 3 commits into from Mar 15, 2022

Conversation

codeimport
Copy link
Contributor

@codeimport codeimport commented Jan 22, 2022

What is the purpose of the change

fix #9582
When the cluster uses the forking mode and the provider side all times out ,consumer side will npe

Brief changelog

org.apache.dubbo.rpc.cluster.support.ForkingClusterInvoker
org.apache.dubbo.rpc.cluster.support.ForkingClusterInvokerTest

Verifying this change

Checklist

  • Make sure there is a GitHub_issue 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 project.
  • Add some description to 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.

@codeimport
Copy link
Contributor Author

When the cluster uses the forking mode and the provider side all times out, the poll method used in forkingClusterInvoker will time out earlier than the provider side, so it will get null from the queue and throw NPE in the subsequent process. The poll method here should not set the timeout time, but wait for the provider to timeout. When the provider times out, the poll method will correctly obtain an RpcException

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2022

Codecov Report

Merging #9613 (1b22d0c) into master (8240ea2) will decrease coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #9613      +/-   ##
============================================
- Coverage     60.89%   60.79%   -0.10%     
  Complexity      448      448              
============================================
  Files          1100     1100              
  Lines         44520    44520              
  Branches       6478     6479       +1     
============================================
- Hits          27111    27067      -44     
- Misses        14441    14483      +42     
- Partials       2968     2970       +2     
Impacted Files Coverage Δ
...bbo/rpc/cluster/support/ForkingClusterInvoker.java 85.71% <100.00%> (-0.40%) ⬇️
...bo/rpc/cluster/support/FailbackClusterInvoker.java 51.61% <0.00%> (-17.75%) ⬇️
...che/dubbo/remoting/transport/mina/MinaChannel.java 35.52% <0.00%> (-10.53%) ⬇️
...ng/transport/dispatcher/all/AllChannelHandler.java 82.75% <0.00%> (-6.90%) ⬇️
...fig/configcenter/TreePathDynamicConfiguration.java 80.00% <0.00%> (-5.72%) ⬇️
...ubbo/registry/support/AbstractRegistryFactory.java 77.46% <0.00%> (-5.64%) ⬇️
...apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java 74.35% <0.00%> (-5.13%) ⬇️
...pport/merger/DefaultProviderURLMergeProcessor.java 78.26% <0.00%> (-4.35%) ⬇️
.../apache/dubbo/remoting/transport/AbstractPeer.java 63.04% <0.00%> (-4.35%) ⬇️
.../main/java/org/apache/dubbo/qos/server/Server.java 75.00% <0.00%> (-4.17%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8240ea2...1b22d0c. Read the comment docs.

Copy link
Member

@wangchengming666 wangchengming666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chickenlj
Copy link
Contributor

Let focus on #9612

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

Successfully merging this pull request may close these issues.

None yet

6 participants