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 2020/09/16 07:13:05 UTC
[GitHub] [dubbo-go] cvictory opened a new pull request #758: fix #750. registry center notify with complete address list
cvictory opened a new pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758
https://github.com/apache/dubbo-go/issues/750
1.fix empty ServiceEvent, we should clear all invokers
2.we want to notify the address with complete address list.
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (51ee140) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e11faed28e4d6c036b5c55bc65c8d7b42af4f0ec?el=desc) (e11faed) will **increase** coverage by `0.35%`.
> The diff coverage is `60.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
+ Coverage 59.91% 60.26% +0.35%
===========================================
Files 260 260
Lines 12807 12829 +22
===========================================
+ Hits 7673 7732 +59
+ Misses 4177 4137 -40
- Partials 957 960 +3
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (+0.98%)` | :arrow_up: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.21% <0.00%> (-0.86%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `80.90% <70.58%> (+6.89%)` | :arrow_up: |
| [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `75.90% <0.00%> (-2.41%)` | :arrow_down: |
| [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `50.52% <0.00%> (ø)` | |
| [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `69.60% <0.00%> (+0.88%)` | :arrow_up: |
| [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `79.34% <0.00%> (+2.17%)` | :arrow_up: |
| [filter/filter\_impl/hystrix\_filter.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-ZmlsdGVyL2ZpbHRlcl9pbXBsL2h5c3RyaXhfZmlsdGVyLmdv) | `70.19% <0.00%> (+2.88%)` | :arrow_up: |
| [remoting/kubernetes/registry\_controller.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9yZWdpc3RyeV9jb250cm9sbGVyLmdv) | `51.42% <0.00%> (+5.30%)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [e11faed...51ee140](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (51ee140) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/25ed35dbcf25569e8cd045ab95550690e4076403?el=desc) (25ed35d) will **increase** coverage by `0.48%`.
> The diff coverage is `60.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
+ Coverage 59.85% 60.33% +0.48%
===========================================
Files 260 260
Lines 12854 12829 -25
===========================================
+ Hits 7694 7741 +47
+ Misses 4199 4129 -70
+ Partials 961 959 -2
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (-3.09%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.21% <0.00%> (-1.62%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `80.90% <70.58%> (+6.89%)` | :arrow_up: |
| [remoting/getty/config.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvY29uZmlnLmdv) | `9.85% <0.00%> (-5.26%)` | :arrow_down: |
| [config/config\_loader.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnL2NvbmZpZ19sb2FkZXIuZ28=) | `53.15% <0.00%> (-0.57%)` | :arrow_down: |
| [registry/zookeeper/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvem9va2VlcGVyL2xpc3RlbmVyLmdv) | `66.66% <0.00%> (-0.50%)` | :arrow_down: |
| [config/service\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnL3NlcnZpY2VfY29uZmlnLmdv) | `62.23% <0.00%> (-0.44%)` | :arrow_down: |
| ... and [20 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [25ed35d...60f53ab](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] zouyx merged pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
zouyx merged pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758
----------------------------------------------------------------
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.
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-go] cvictory commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
cvictory commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r490670468
##########
File path: registry/nacos/registry_test.go
##########
@@ -35,6 +36,9 @@ import (
)
func TestNacosRegistry_Register(t *testing.T) {
+ if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
Review comment:
done
----------------------------------------------------------------
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.
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-go] cvictory commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
cvictory commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r539149751
##########
File path: registry/protocol/protocol.go
##########
@@ -241,18 +241,23 @@ func newOverrideSubscribeListener(overriderUrl *common.URL, invoker protocol.Inv
}
// Notify will be triggered when a service change notification is received.
-func (nl *overrideSubscribeListener) Notify(events ...*registry.ServiceEvent) {
- if len(events) == 0 {
- return
- }
+func (nl *overrideSubscribeListener) Notify(event *registry.ServiceEvent) {
- event := events[0]
if isMatched(&(event.Service), nl.url) && event.Action == remoting.EventTypeAdd {
nl.configurator = extension.GetDefaultConfigurator(&(event.Service))
nl.doOverrideIfNecessary()
}
}
+func (nl *overrideSubscribeListener) NotifyAll(events []*registry.ServiceEvent) {
+ if len(events) == 0 {
+ return
+ }
+
+ event := events[0]
+ nl.Notify(event)
+}
Review comment:
done
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (d4fed01) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/25ed35dbcf25569e8cd045ab95550690e4076403?el=desc) (25ed35d) will **decrease** coverage by `0.04%`.
> The diff coverage is `64.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
- Coverage 59.85% 59.81% -0.05%
===========================================
Files 260 260
Lines 12854 12885 +31
===========================================
+ Hits 7694 7707 +13
- Misses 4199 4215 +16
- Partials 961 963 +2
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (-3.09%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.96% <0.00%> (-0.88%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `79.80% <72.72%> (+5.79%)` | :arrow_up: |
| [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `43.90% <0.00%> (-4.88%)` | :arrow_down: |
| [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `64.31% <0.00%> (-4.41%)` | :arrow_down: |
| [remoting/kubernetes/registry\_controller.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9yZWdpc3RyeV9jb250cm9sbGVyLmdv) | `49.79% <0.00%> (-1.64%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [25ed35d...068505d](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (0cb6305) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/ab774b578174011f1ebbea541aeb561c6d3463f4?el=desc) (ab774b5) will **decrease** coverage by `0.10%`.
> The diff coverage is `69.44%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
- Coverage 60.08% 59.97% -0.11%
===========================================
Files 260 260
Lines 12856 12896 +40
===========================================
+ Hits 7725 7735 +10
- Misses 4167 4196 +29
- Partials 964 965 +1
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `68.54% <ø> (-2.09%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.96% <0.00%> (-0.88%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `79.72% <75.75%> (+5.71%)` | :arrow_up: |
| [config\_center/nacos/facade.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9mYWNhZGUuZ28=) | `79.31% <0.00%> (-10.35%)` | :arrow_down: |
| [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `29.66% <0.00%> (-9.33%)` | :arrow_down: |
| [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `43.90% <0.00%> (-4.88%)` | :arrow_down: |
| [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `50.52% <0.00%> (-3.16%)` | :arrow_down: |
| [config\_center/nacos/client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9jbGllbnQuZ28=) | `65.26% <0.00%> (-2.11%)` | :arrow_down: |
| [remoting/kubernetes/registry\_controller.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9yZWdpc3RyeV9jb250cm9sbGVyLmdv) | `49.79% <0.00%> (-1.64%)` | :arrow_down: |
| ... and [3 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [ab774b5...0cb6305](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (c0df344) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/25ed35dbcf25569e8cd045ab95550690e4076403?el=desc) (25ed35d) will **increase** coverage by `0.06%`.
> The diff coverage is `69.44%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
+ Coverage 59.85% 59.91% +0.06%
===========================================
Files 260 260
Lines 12854 12894 +40
===========================================
+ Hits 7694 7726 +32
- Misses 4199 4202 +3
- Partials 961 966 +5
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (-3.09%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.96% <0.00%> (-0.88%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `79.72% <75.75%> (+5.71%)` | :arrow_up: |
| [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `72.72% <0.00%> (-3.04%)` | :arrow_down: |
| [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `75.90% <0.00%> (-2.41%)` | :arrow_down: |
| [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `77.17% <0.00%> (-2.18%)` | :arrow_down: |
| [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `50.52% <0.00%> (ø)` | |
| [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `69.60% <0.00%> (+0.88%)` | :arrow_up: |
| ... and [1 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [25ed35d...af608d8](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (0cb6305) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/ab774b578174011f1ebbea541aeb561c6d3463f4?el=desc) (ab774b5) will **decrease** coverage by `0.03%`.
> The diff coverage is `69.44%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
- Coverage 60.08% 60.04% -0.04%
===========================================
Files 260 260
Lines 12856 12896 +40
===========================================
+ Hits 7725 7744 +19
- Misses 4167 4185 +18
- Partials 964 967 +3
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `68.54% <ø> (-2.09%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.96% <0.00%> (-0.88%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `79.72% <75.75%> (+5.71%)` | :arrow_up: |
| [config\_center/nacos/facade.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9mYWNhZGUuZ28=) | `79.31% <0.00%> (-10.35%)` | :arrow_down: |
| [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `29.66% <0.00%> (-9.33%)` | :arrow_down: |
| [config\_center/nacos/client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9jbGllbnQuZ28=) | `65.26% <0.00%> (-2.11%)` | :arrow_down: |
| [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `68.72% <0.00%> (-0.89%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [ab774b5...0cb6305](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] zouyx commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r498338518
##########
File path: registry/protocol/protocol.go
##########
@@ -241,18 +241,23 @@ func newOverrideSubscribeListener(overriderUrl *common.URL, invoker protocol.Inv
}
// Notify will be triggered when a service change notification is received.
-func (nl *overrideSubscribeListener) Notify(events ...*registry.ServiceEvent) {
- if len(events) == 0 {
- return
- }
+func (nl *overrideSubscribeListener) Notify(event *registry.ServiceEvent) {
- event := events[0]
if isMatched(&(event.Service), nl.url) && event.Action == remoting.EventTypeAdd {
nl.configurator = extension.GetDefaultConfigurator(&(event.Service))
nl.doOverrideIfNecessary()
}
}
+func (nl *overrideSubscribeListener) NotifyAll(events []*registry.ServiceEvent) {
+ if len(events) == 0 {
+ return
+ }
+
+ event := events[0]
+ nl.Notify(event)
+}
Review comment:
why notify all just get first element?
##########
File path: cluster/router/chain/chain.go
##########
@@ -186,9 +186,6 @@ func (c *RouterChain) copyInvokerIfNecessary(cache *InvokerCache) []protocol.Inv
func (c *RouterChain) buildCache() {
origin := c.loadCache()
invokers := c.copyInvokerIfNecessary(origin)
- if invokers == nil || len(invokers) == 0 {
- return
- }
Review comment:
why delete this block?
----------------------------------------------------------------
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.
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-go] AlexStocks commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r489366184
##########
File path: registry/nacos/registry_test.go
##########
@@ -35,6 +36,9 @@ import (
)
func TestNacosRegistry_Register(t *testing.T) {
+ if _, err := http.Get("http://console.nacos.io/nacos/"); err != nil {
Review comment:
maybe u'd better encapsulate a func to delete duplicate codes.
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (068505d) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/25ed35dbcf25569e8cd045ab95550690e4076403?el=desc) (25ed35d) will **decrease** coverage by `0.19%`.
> The diff coverage is `69.44%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
- Coverage 59.85% 59.66% -0.20%
===========================================
Files 260 260
Lines 12854 12894 +40
===========================================
- Hits 7694 7693 -1
- Misses 4199 4244 +45
+ Partials 961 957 -4
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (-3.09%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.96% <0.00%> (-0.88%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `79.72% <75.75%> (+5.71%)` | :arrow_up: |
| [metadata/report/nacos/report.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L25hY29zL3JlcG9ydC5nbw==) | `8.33% <0.00%> (-59.73%)` | :arrow_down: |
| [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `43.90% <0.00%> (-4.88%)` | :arrow_down: |
| [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `75.90% <0.00%> (-2.41%)` | :arrow_down: |
| [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `63.74% <0.00%> (+2.92%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [25ed35d...068505d](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] LaurenceLiZhixin commented on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-742416139
LGTM
----------------------------------------------------------------
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.
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-go] AlexStocks commented on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
AlexStocks commented on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-710053398
@hequn @lizhixin
----------------------------------------------------------------
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.
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-go] cvictory commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
cvictory commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r542042372
##########
File path: cluster/router/chain/chain.go
##########
@@ -186,9 +186,6 @@ func (c *RouterChain) copyInvokerIfNecessary(cache *InvokerCache) []protocol.Inv
func (c *RouterChain) buildCache() {
origin := c.loadCache()
invokers := c.copyInvokerIfNecessary(origin)
- if invokers == nil || len(invokers) == 0 {
- return
- }
Review comment:
delete empty protection. When the address is empty, the route should be refresh.
##########
File path: registry/directory/directory.go
##########
@@ -97,69 +99,128 @@ func NewRegistryDirectory(url *common.URL, registry registry.Registry) (cluster.
// subscribe from registry
func (dir *RegistryDirectory) subscribe(url *common.URL) {
+ logger.Debugf("subscribe service :%s for RegistryDirectory.", url.Key())
dir.consumerConfigurationListener.addNotifyListener(dir)
dir.referenceConfigurationListener = newReferenceConfigurationListener(dir, url)
dir.registry.Subscribe(url, dir)
}
// Notify monitor changes from registry,and update the cacheServices
-func (dir *RegistryDirectory) Notify(events ...*registry.ServiceEvent) {
- go dir.refreshInvokers(events...)
+func (dir *RegistryDirectory) Notify(event *registry.ServiceEvent) {
+ if event == nil {
+ return
+ }
+ go dir.refreshInvokers(event)
+}
+
+// NotifyAll notify the events that are complete Service Event List.
+// After notify the address, the callback func will be invoked.
+func (dir *RegistryDirectory) NotifyAll(events []*registry.ServiceEvent, callback func()) {
+ go dir.refreshAllInvokers(events, callback)
+}
+
+// refreshInvokers refreshes service's events.
+func (dir *RegistryDirectory) refreshInvokers(event *registry.ServiceEvent) {
+ if event != nil {
+ logger.Debugf("refresh invokers with %+v")
Review comment:
done.
----------------------------------------------------------------
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.
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-go] LaurenceLiZhixin commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r540029856
##########
File path: registry/directory/directory.go
##########
@@ -97,69 +99,128 @@ func NewRegistryDirectory(url *common.URL, registry registry.Registry) (cluster.
// subscribe from registry
func (dir *RegistryDirectory) subscribe(url *common.URL) {
+ logger.Debugf("subscribe service :%s for RegistryDirectory.", url.Key())
dir.consumerConfigurationListener.addNotifyListener(dir)
dir.referenceConfigurationListener = newReferenceConfigurationListener(dir, url)
dir.registry.Subscribe(url, dir)
}
// Notify monitor changes from registry,and update the cacheServices
-func (dir *RegistryDirectory) Notify(events ...*registry.ServiceEvent) {
- go dir.refreshInvokers(events...)
+func (dir *RegistryDirectory) Notify(event *registry.ServiceEvent) {
+ if event == nil {
+ return
+ }
+ go dir.refreshInvokers(event)
+}
+
+// NotifyAll notify the events that are complete Service Event List.
+// After notify the address, the callback func will be invoked.
+func (dir *RegistryDirectory) NotifyAll(events []*registry.ServiceEvent, callback func()) {
+ go dir.refreshAllInvokers(events, callback)
+}
+
+// refreshInvokers refreshes service's events.
+func (dir *RegistryDirectory) refreshInvokers(event *registry.ServiceEvent) {
+ if event != nil {
+ logger.Debugf("refresh invokers with %+v")
Review comment:
Event detail may be left in func Debugf
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (a5bd416) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/ab774b578174011f1ebbea541aeb561c6d3463f4?el=desc) (ab774b5) will **decrease** coverage by `0.18%`.
> The diff coverage is `69.44%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
- Coverage 60.08% 59.90% -0.19%
===========================================
Files 260 260
Lines 12856 12894 +38
===========================================
- Hits 7725 7724 -1
- Misses 4167 4203 +36
- Partials 964 967 +3
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (-10.31%)` | :arrow_down: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.96% <0.00%> (-0.88%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `79.72% <75.75%> (+5.71%)` | :arrow_up: |
| [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `29.66% <0.00%> (-9.33%)` | :arrow_down: |
| [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `50.52% <0.00%> (-3.16%)` | :arrow_down: |
| [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `72.72% <0.00%> (-3.04%)` | :arrow_down: |
| [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `77.17% <0.00%> (-2.18%)` | :arrow_down: |
| [common/url.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29tbW9uL3VybC5nbw==) | `56.59% <0.00%> (-1.93%)` | :arrow_down: |
| ... and [12 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [ab774b5...0cb6305](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] codecov-io commented on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (6053327) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e11faed28e4d6c036b5c55bc65c8d7b42af4f0ec?el=desc) (e11faed) will **increase** coverage by `0.00%`.
> The diff coverage is `55.55%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
========================================
Coverage 59.91% 59.91%
========================================
Files 260 259 -1
Lines 12807 12743 -64
========================================
- Hits 7673 7635 -38
+ Misses 4177 4157 -20
+ Partials 957 951 -6
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.21% <0.00%> (-0.86%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `80.61% <66.66%> (+6.60%)` | :arrow_up: |
| [config\_center/nacos/facade.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9uYWNvcy9mYWNhZGUuZ28=) | `79.31% <0.00%> (-10.35%)` | :arrow_down: |
| [registry/consul/registry.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvY29uc3VsL3JlZ2lzdHJ5Lmdv) | `39.34% <0.00%> (-9.99%)` | :arrow_down: |
| [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `60.36% <0.00%> (-8.37%)` | :arrow_down: |
| [remoting/getty/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvbGlzdGVuZXIuZ28=) | `35.91% <0.00%> (-7.05%)` | :arrow_down: |
| [remoting/getty/getty\_client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvZ2V0dHlfY2xpZW50Lmdv) | `41.17% <0.00%> (-5.42%)` | :arrow_down: |
| [filter/filter\_impl/generic\_filter.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-ZmlsdGVyL2ZpbHRlcl9pbXBsL2dlbmVyaWNfZmlsdGVyLmdv) | `68.51% <0.00%> (-3.62%)` | :arrow_down: |
| [protocol/grpc/client.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cHJvdG9jb2wvZ3JwYy9jbGllbnQuZ28=) | `59.09% <0.00%> (-3.41%)` | :arrow_down: |
| ... and [25 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [e11faed...51ee140](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] codecov-io edited a comment on pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#issuecomment-726488883
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=h1) Report
> Merging [#758](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=desc) (51ee140) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/e11faed28e4d6c036b5c55bc65c8d7b42af4f0ec?el=desc) (e11faed) will **increase** coverage by `0.42%`.
> The diff coverage is `60.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/758/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #758 +/- ##
===========================================
+ Coverage 59.91% 60.33% +0.42%
===========================================
Files 260 260
Lines 12807 12829 +22
===========================================
+ Hits 7673 7741 +68
+ Misses 4177 4129 -48
- Partials 957 959 +2
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `60.33% <ø> (+0.98%)` | :arrow_up: |
| [registry/nacos/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvbmFjb3Mvc2VydmljZV9kaXNjb3ZlcnkuZ28=) | `64.13% <0.00%> (-0.45%)` | :arrow_down: |
| [registry/protocol/protocol.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvcHJvdG9jb2wvcHJvdG9jb2wuZ28=) | `76.21% <0.00%> (-0.86%)` | :arrow_down: |
| [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `80.90% <70.58%> (+6.89%)` | :arrow_up: |
| [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `69.60% <0.00%> (+0.88%)` | :arrow_up: |
| [filter/filter\_impl/hystrix\_filter.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-ZmlsdGVyL2ZpbHRlcl9pbXBsL2h5c3RyaXhfZmlsdGVyLmdv) | `70.19% <0.00%> (+2.88%)` | :arrow_up: |
| [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `53.68% <0.00%> (+3.15%)` | :arrow_up: |
| [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `81.52% <0.00%> (+4.34%)` | :arrow_up: |
| [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `51.16% <0.00%> (+4.65%)` | :arrow_up: |
| [remoting/kubernetes/registry\_controller.go](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9yZWdpc3RyeV9jb250cm9sbGVyLmdv) | `51.42% <0.00%> (+5.30%)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/apache/dubbo-go/pull/758/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/758?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-go/pull/758?src=pr&el=footer). Last update [e11faed...51ee140](https://codecov.io/gh/apache/dubbo-go/pull/758?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
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.
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-go] beiwei30 commented on a change in pull request #758: fix #750. registry center notify with complete address list
Posted by GitBox <gi...@apache.org>.
beiwei30 commented on a change in pull request #758:
URL: https://github.com/apache/dubbo-go/pull/758#discussion_r489499773
##########
File path: registry/directory/directory.go
##########
@@ -104,44 +104,65 @@ func (dir *RegistryDirectory) subscribe(url *common.URL) {
}
// Notify monitor changes from registry,and update the cacheServices
-func (dir *RegistryDirectory) Notify(events ...*registry.ServiceEvent) {
- go dir.refreshInvokers(events...)
+func (dir *RegistryDirectory) Notify(event *registry.ServiceEvent) {
+ if event == nil {
+ return
+ }
+ go dir.refreshInvokers(event)
}
-// refreshInvokers refreshes service's events. It supports two modes: incremental mode and batch mode. If a single
-// service event is passed in, then it is incremental mode, and if an array of service events are passed in, it is
-// batch mode, in this mode, we assume the registry center have the complete list of the service events, therefore
-// in this case, we can safely assume any cached invoker not in the incoming list can be removed. It is necessary
-// since in batch mode, the register center handles the different type of events by itself, then notify the directory
-// a batch of 'Update' events, instead of omit the different type of event one by one.
-func (dir *RegistryDirectory) refreshInvokers(events ...*registry.ServiceEvent) {
- var oldInvokers []protocol.Invoker
-
- // in batch mode, it is safe to remove since we have the complete list of events.
- if len(events) > 1 {
- dir.cacheInvokersMap.Range(func(k, v interface{}) bool {
- if !dir.eventMatched(k.(string), events) {
- if invoker := dir.uncacheInvokerWithKey(k.(string)); invoker != nil {
- oldInvokers = append(oldInvokers, invoker)
- }
- }
- return true
- })
+func (dir *RegistryDirectory) NotifyAll(events []*registry.ServiceEvent) {
+ go dir.refreshAllInvokers(events)
+}
+
+// refreshInvokers refreshes service's events.
+func (dir *RegistryDirectory) refreshInvokers(event *registry.ServiceEvent) {
+ logger.Debugf("refresh invokers with %+v", event)
+ var oldInvoker protocol.Invoker
+ if event != nil {
+ oldInvoker, _ = dir.cacheInvokerByEvent(event)
+ }
+ dir.setNewInvokers()
+ if oldInvoker != nil {
+ oldInvoker.Destroy()
}
+}
+
+// refreshAllInvokers the argument is the complete list of the service events, we can safely assume any cached invoker
+// not in the incoming list can be removed. It will ignore Action of serviceEvent.
+func (dir *RegistryDirectory) refreshAllInvokers(events []*registry.ServiceEvent) {
+ var (
+ oldInvokers []protocol.Invoker
+ addEvents []*registry.ServiceEvent
+ )
+ // get need clear invokers from original invoker list
+ dir.cacheInvokersMap.Range(func(k, v interface{}) bool {
+ if !dir.eventMatched(k.(string), events) {
+ // delete unused invoker from cache
+ if invoker := dir.uncacheInvokerWithKey(k.(string)); invoker != nil {
+ oldInvokers = append(oldInvokers, invoker)
+ }
+ }
+ return true
+ })
+ // get need add invokers from events
for _, event := range events {
+ // Is the key (url.Key()) of cacheInvokersMap the best way?
Review comment:
this is necessary, we should assume (safely) that all events are UPDATE events, otherwise how would you process DELETE events? plus, per the comment on the interface:
```
// The argument of events []*ServiceEvent is equal to urls []*URL, because Action of ServiceEvent will be ignored.
```
----------------------------------------------------------------
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.
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