You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "scxwhite (GitHub)" <gi...@apache.org> on 2019/01/18 07:01:30 UTC
[GitHub] [incubator-dubbo] scxwhite opened pull request #3269:
sharedExecutor use lazy-init
## What is the purpose of the change
sharedExecutor use lazy-init
## Brief changelog
Shared Executor is not used in most cases. I think we should use lazy initialization instead of hungry initialization.
## 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/incubator-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.
- [x] 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](https://github.com/apache/incubator-dubbo/tree/master/dubbo-test).
- [x] 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/incubator-dubbo/wiki/Software-donation-guide).
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] codecov-io commented on issue #3269:
sharedExecutor use lazy-init
Posted by "codecov-io (GitHub)" <gi...@apache.org>.
# [Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/3269?src=pr&el=h1) Report
> Merging [#3269](https://codecov.io/gh/apache/incubator-dubbo/pull/3269?src=pr&el=desc) into [master](https://codecov.io/gh/apache/incubator-dubbo/commit/fda71e764be730508a421f884456414b451f78ee?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `83.33%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/graphs/tree.svg?width=650&token=VnEIkiFQT0&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dubbo/pull/3269?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## master #3269 +/- ##
===========================================
- Coverage 63.91% 63.9% -0.01%
Complexity 75 75
===========================================
Files 653 653
Lines 28218 28222 +4
Branches 4778 4780 +2
===========================================
+ Hits 18035 18036 +1
+ Misses 7995 7994 -1
- Partials 2188 2192 +4
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-dubbo/pull/3269?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...ng/transport/dispatcher/WrappedChannelHandler.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvZGlzcGF0Y2hlci9XcmFwcGVkQ2hhbm5lbEhhbmRsZXIuamF2YQ==) | `51.21% <83.33%> (+2.57%)` | `0 <0> (ø)` | :arrow_down: |
| [...ache/dubbo/remoting/p2p/support/AbstractGroup.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctcDJwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9wMnAvc3VwcG9ydC9BYnN0cmFjdEdyb3VwLmphdmE=) | `45.45% <0%> (-11.37%)` | `0% <0%> (ø)` | |
| [.../apache/dubbo/remoting/transport/AbstractPeer.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy90cmFuc3BvcnQvQWJzdHJhY3RQZWVyLmphdmE=) | `63.04% <0%> (-4.35%)` | `0% <0%> (ø)` | |
| [...he/dubbo/remoting/transport/netty/NettyServer.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctbmV0dHkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JlbW90aW5nL3RyYW5zcG9ydC9uZXR0eS9OZXR0eVNlcnZlci5qYXZh) | `69.64% <0%> (-3.58%)` | `0% <0%> (ø)` | |
| [...pache/dubbo/registry/support/AbstractRegistry.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcmVnaXN0cnkvZHViYm8tcmVnaXN0cnktYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZWdpc3RyeS9zdXBwb3J0L0Fic3RyYWN0UmVnaXN0cnkuamF2YQ==) | `79.61% <0%> (-1.93%)` | `0% <0%> (ø)` | |
| [...dubbo/remoting/exchange/support/DefaultFuture.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcmVtb3RpbmcvZHViYm8tcmVtb3RpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kdWJiby9yZW1vdGluZy9leGNoYW5nZS9zdXBwb3J0L0RlZmF1bHRGdXR1cmUuamF2YQ==) | `73.64% <0%> (-0.68%)` | `0% <0%> (ø)` | |
| [.../java/org/apache/dubbo/config/ReferenceConfig.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tY29uZmlnL2R1YmJvLWNvbmZpZy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL2NvbmZpZy9SZWZlcmVuY2VDb25maWcuamF2YQ==) | `60% <0%> (-0.38%)` | `0% <0%> (ø)` | |
| [...a/org/apache/dubbo/monitor/dubbo/DubboMonitor.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tbW9uaXRvci9kdWJiby1tb25pdG9yLWRlZmF1bHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL21vbml0b3IvZHViYm8vRHViYm9Nb25pdG9yLmphdmE=) | `89.71% <0%> (+1.86%)` | `0% <0%> (ø)` | :arrow_down: |
| [...org/apache/dubbo/rpc/protocol/AbstractInvoker.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9wcm90b2NvbC9BYnN0cmFjdEludm9rZXIuamF2YQ==) | `66.12% <0%> (+3.22%)` | `0% <0%> (ø)` | :arrow_down: |
| [...c/main/java/org/apache/dubbo/rpc/RpcException.java](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree#diff-ZHViYm8tcnBjL2R1YmJvLXJwYy1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2R1YmJvL3JwYy9ScGNFeGNlcHRpb24uamF2YQ==) | `86.2% <0%> (+3.44%)` | `0% <0%> (ø)` | :arrow_down: |
| ... and [2 more](https://codecov.io/gh/apache/incubator-dubbo/pull/3269/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dubbo/pull/3269?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/incubator-dubbo/pull/3269?src=pr&el=footer). Last update [fda71e7...5fc1169](https://codecov.io/gh/apache/incubator-dubbo/pull/3269?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #3269:
sharedExecutor use lazy-init
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
I think this approach complicates the code, in which case we should choose memory and code complexity. Obviously, the increase of an object is not enough for us to add more judgments and locks. Of course, it does not seem that we are not responsible.
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #3269:
sharedExecutor use lazy-init
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
It looks like trivial, an object does not take up much memory. There is no need to complicate our code for this.
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] scxwhite commented on issue #3269:
sharedExecutor use lazy-init
Posted by "scxwhite (GitHub)" <gi...@apache.org>.
> I think this approach complicates the code, in which case we should choose memory and code complexity. Obviously, the increase of an object is not enough for us to add more judgments and locks. Of course, it does not seem that we are not responsible for our code.
ok.Learning.
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh commented on issue #3269:
sharedExecutor use lazy-init
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
I think this approach complicates the code, in which case we should choose memory and code complexity. Obviously, the increase of an object is not enough for us to add more judgments and locks. Of course, it does not seem that we are not responsible for our code.
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] carryxyh closed pull request #3269:
sharedExecutor use lazy-init
Posted by "carryxyh (GitHub)" <gi...@apache.org>.
[ pull request closed by carryxyh ]
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [incubator-dubbo] scxwhite commented on issue #3269:
sharedExecutor use lazy-init
Posted by "scxwhite (GitHub)" <gi...@apache.org>.
> It looks like trivial, an object does not take up much memory. There is no need to complicate our code for this.
> It looks like trivial, an object does not take up much memory. There is no need to complicate our code for this.
I don't agree with you. Many users are using dubbo, so you can't ignore an object because you think it takes up a small amount of memory. We should be responsible for these users.
[ Full content available at: https://github.com/apache/incubator-dubbo/pull/3269 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org