You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "zhaixiaoxiang (GitHub)" <gi...@apache.org> on 2019/12/15 11:13:40 UTC

[GitHub] [dubbo] zhaixiaoxiang opened pull request #5484: Refactor getRegistry: firstly get registry outside from lock

## What is the purpose of the change

refactor `get registry singleton`

## Brief changelog

AbstractRegistryFactory.java

## Verifying this change

XXXXX

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

- [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.
- [ ] 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 sample in [dubbo samples](https://github.com/apache/dubbo-samples) project.
- [ ] Run `mvn clean install -DskipTests=false` & `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](https://github.com/apache/dubbo/wiki/Software-donation-guide).


[ Full content available at: https://github.com/apache/dubbo/pull/5484 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [dubbo] codecov-io commented on issue #5484: Refactor getRegistry: firstly get registry outside from lock

Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=h1) Report
> Merging [#5484](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=desc) into [master](https://codecov.io/gh/apache/dubbo/commit/839d2a604e629ea9e96b964be09ae221e85312ba?src=pr&el=desc) will **decrease** coverage by `0.06%`.
> The diff coverage is `70.58%`.

[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo/pull/5484/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=tree)

```diff
@@             Coverage Diff              @@
##             master    #5484      +/-   ##
============================================
- Coverage     61.08%   61.01%   -0.07%     
+ Complexity      422      421       -1     
============================================
  Files           919      919              
  Lines         37502    37502              
  Branches       5444     5444              
============================================
- Hits          22909    22883      -26     
- Misses        12097    12124      +27     
+ Partials       2496     2495       -1
```


| [Impacted Files](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ubbo/registry/support/AbstractRegistryFactory.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9zdXBwb3J0L0Fic3RyYWN0UmVnaXN0cnlGYWN0b3J5LmphdmE=) | `70.58% <70.58%> (ø)` | `0 <0> (ø)` | :arrow_down: |
| [...che/dubbo/remoting/transport/mina/MinaChannel.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbWluYS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHViYm8vcmVtb3RpbmcvdHJhbnNwb3J0L21pbmEvTWluYUNoYW5uZWwuamF2YQ==) | `43.42% <0%> (-10.53%)` | `16% <0%> (-1%)` | |
| [.../remoting/transport/netty4/NettyServerHandler.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5U2VydmVySGFuZGxlci5qYXZh) | `59.09% <0%> (-9.1%)` | `0% <0%> (ø)` | |
| [...ng/exchange/support/header/HeartbeatTimerTask.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L2hlYWRlci9IZWFydGJlYXRUaW1lclRhc2suamF2YQ==) | `73.68% <0%> (-5.27%)` | `0% <0%> (ø)` | |
| [.../org/apache/dubbo/remoting/ExecutionException.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9FeGVjdXRpb25FeGNlcHRpb24uamF2YQ==) | `15.78% <0%> (-5.27%)` | `0% <0%> (ø)` | |
| [.../remoting/transport/netty4/NettyClientHandler.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHk0L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvbmV0dHk0L05ldHR5Q2xpZW50SGFuZGxlci5qYXZh) | `59.32% <0%> (-5.09%)` | `0% <0%> (ø)` | |
| [.../apache/dubbo/remoting/transport/AbstractPeer.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RQZWVyLmphdmE=) | `58.69% <0%> (-4.35%)` | `0% <0%> (ø)` | |
| [...pache/dubbo/registry/support/AbstractRegistry.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9zdXBwb3J0L0Fic3RyYWN0UmVnaXN0cnkuamF2YQ==) | `77.15% <0%> (-3%)` | `0% <0%> (ø)` | |
| [...exchange/support/header/HeaderExchangeHandler.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L2hlYWRlci9IZWFkZXJFeGNoYW5nZUhhbmRsZXIuamF2YQ==) | `61.94% <0%> (-2.66%)` | `0% <0%> (ø)` | |
| [...rg/apache/dubbo/common/timer/HashedWheelTimer.java](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree#diff-ZHViYm8tY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9jb21tb24vdGltZXIvSGFzaGVkV2hlZWxUaW1lci5qYXZh) | `63.1% <0%> (-0.35%)` | `0% <0%> (ø)` | |
| ... and [3 more](https://codecov.io/gh/apache/dubbo/pull/5484/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=footer). Last update [839d2a6...5992484](https://codecov.io/gh/apache/dubbo/pull/5484?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


[ Full content available at: https://github.com/apache/dubbo/pull/5484 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [dubbo] CodingSinger commented on pull request #5484: Refactor getRegistry: firstly get registry outside from lock

Posted by "CodingSinger (GitHub)" <gi...@apache.org>.
i think shouldn't move those code outside the lock-unlock block. it will cause invoke createRegistry multiple times in some cases.

[ Full content available at: https://github.com/apache/dubbo/pull/5484 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org