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

[Dubbo-1765] Fix ReferenceBean initialization issue #1999

Merged
merged 1 commit into from
Aug 1, 2018

Conversation

ATAKing1023
Copy link
Contributor

What is the purpose of the change

Fixed a bug described in Dubbo-1765

If the provider is temporarily unavailable, the reference bean initialization will failed with exception. However, the initialized flag will be set to true, which will cause spring to hold a NULL_OBJECT cache. The subsequent call will always get a null instance.

This change will allow the consumer to obtain the correct instance when provider become available.

Brief changelog

  • Set initialized=false in ReferenceConfig when provider is not available.

Verifying this change

unit test passed

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue filed 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.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. 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.
  • 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 integration-test in test module.
  • Run mvn clean install -DskipTests & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link

Codecov Report

Merging #1999 into master will increase coverage by 1.22%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #1999      +/-   ##
===========================================
+ Coverage     50.98%   52.2%   +1.22%     
- Complexity     4775    4912     +137     
===========================================
  Files           562     562              
  Lines         25218   25249      +31     
  Branches       4449    4450       +1     
===========================================
+ Hits          12857   13181     +324     
+ Misses        10431   10065     -366     
- Partials       1930    2003      +73
Impacted Files Coverage Δ Complexity Δ
.../java/org/apache/dubbo/config/ReferenceConfig.java 51.41% <100%> (+3.73%) 43 <0> (+5) ⬆️
...he/dubbo/remoting/transport/netty/NettyClient.java 72.88% <0%> (-8.48%) 12% <0%> (-1%)
...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java 41.66% <0%> (-8.34%) 3% <0%> (ø)
.../dubbo/remoting/transport/netty4/NettyChannel.java 60% <0%> (-6.25%) 21% <0%> (-2%)
...e/dubbo/remoting/transport/netty4/NettyServer.java 72.13% <0%> (-3.28%) 9% <0%> (-1%)
...bo/remoting/transport/netty/NettyCodecAdapter.java 53.12% <0%> (-1.57%) 3% <0%> (ø)
...in/java/org/apache/dubbo/rpc/support/RpcUtils.java 20.77% <0%> (+1.29%) 12% <0%> (+1%) ⬆️
...a/org/apache/dubbo/monitor/dubbo/DubboMonitor.java 89.71% <0%> (+1.86%) 15% <0%> (ø) ⬇️
.../remoting/transport/netty4/NettyServerHandler.java 77.08% <0%> (+4.86%) 8% <0%> (+2%) ⬆️
... and 27 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 534fd24...4682575. Read the comment docs.

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.

3 participants