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 2021/12/13 16:07:13 UTC
[GitHub] [dubbo-go] Mulavar opened a new pull request #1665: [WIP]refactor zk dynamic configuration listener
Mulavar opened a new pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665
<!-- Thanks for sending a pull request!
Read https://github.com/apache/dubbo-go/blob/master/CONTRIBUTING.md before commit pull request.
-->
**What this PR does**:
**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #
**Special notes for your reviewer**:
**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
```
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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-commenter edited a comment on pull request #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#issuecomment-992650991
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1665](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2909c83) into [3.0](https://codecov.io/gh/apache/dubbo-go/commit/8f207c3b28373a2edbe76a259a65d9eba5307e50?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8f207c3) will **decrease** coverage by `0.10%`.
> The diff coverage is `10.81%`.
> :exclamation: Current head 2909c83 differs from pull request most recent head 2214220. Consider uploading reports for the commit 2214220 to get more accurate results
[](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## 3.0 #1665 +/- ##
==========================================
- Coverage 41.25% 41.15% -0.11%
==========================================
Files 254 254
Lines 14582 14621 +39
==========================================
+ Hits 6016 6017 +1
- Misses 7869 7905 +36
- Partials 697 699 +2
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [config/consumer\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbnN1bWVyX2NvbmZpZy5nbw==) | `21.42% <0.00%> (ø)` | |
| [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `0.00% <0.00%> (ø)` | |
| [remoting/zookeeper/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvem9va2VlcGVyL2xpc3RlbmVyLmdv) | `0.00% <0.00%> (ø)` | |
| [cluster/router/v3router/router\_chain.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9yb3V0ZXIvdjNyb3V0ZXIvcm91dGVyX2NoYWluLmdv) | `39.39% <12.50%> (-2.41%)` | :arrow_down: |
| [remoting/nacos/builder.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3RpbmcvbmFjb3MvYnVpbGRlci5nbw==) | `80.00% <66.66%> (-3.02%)` | :arrow_down: |
| [filter/metrics/filter.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL21ldHJpY3MvZmlsdGVyLmdv) | `85.00% <0.00%> (-15.00%)` | :arrow_down: |
| [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `34.43% <0.00%> (-0.67%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [8f207c3...2214220](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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] Mulavar commented on a change in pull request #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
Mulavar commented on a change in pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#discussion_r771197429
##########
File path: remoting/zookeeper/listener.go
##########
@@ -81,6 +76,56 @@ func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener remotin
}(zkPath, listener)
}
+// ListenConfigurationEvent listen a path node event
+func (l *ZkEventListener) ListenConfigurationEvent(zkPath string, listener remoting.DataListener) {
+ // listen l service node
+ l.wg.Add(1)
+ go func(zkPath string, listener remoting.DataListener) {
+ var eventChan = make(chan zk.Event, 16)
+ l.Client.RegisterEvent(zkPath, eventChan)
+ for {
+ select {
+ case event := <-eventChan:
+ logger.Infof("[ZkEventListener]Receive configuration change event:%#v", event)
+ if event.Type == zk.EventNodeChildrenChanged || event.Type == zk.EventNotWatching {
+ continue
+ }
+ // 1. Re-set watcher for the zk node
+ _, _, _, err := l.Client.Conn.ExistsW(event.Path)
+ if err != nil {
+ logger.Warnf("[ZkEventListener]Re-set watcher error, the reason is %+v", err)
+ }
+
+ action := remoting.EventTypeAdd
+ var content string
+ if event.Type == zk.EventNodeDeleted {
+ action = remoting.EventTypeDel
+ } else {
+ // 2. Try to get new configuration value of the zk node
+ // Notice: The order of step 1 and step 2 cannot be swapped, if you get value(with timestamp t1)
+ // before re-set the watcher(with timestamp t2), and some one change the data of the zk node after
+ // t2 but before t1, you may get the old value, and the new value will not trigger the event.
+ contentBytes, _, err := l.Client.Conn.Get(event.Path)
+ if err != nil {
Review comment:
you're right, it's better do not continue the execution, I'll fix it.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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 merged pull request #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
AlexStocks merged pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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-commenter commented on pull request #1665: [WIP]refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#issuecomment-992650991
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1665](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2909c83) into [3.0](https://codecov.io/gh/apache/dubbo-go/commit/8f207c3b28373a2edbe76a259a65d9eba5307e50?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8f207c3) will **decrease** coverage by `0.10%`.
> The diff coverage is `10.81%`.
> :exclamation: Current head 2909c83 differs from pull request most recent head 56eb165. Consider uploading reports for the commit 56eb165 to get more accurate results
[](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## 3.0 #1665 +/- ##
==========================================
- Coverage 41.25% 41.15% -0.11%
==========================================
Files 254 254
Lines 14582 14621 +39
==========================================
+ Hits 6016 6017 +1
- Misses 7869 7905 +36
- Partials 697 699 +2
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [config/consumer\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbnN1bWVyX2NvbmZpZy5nbw==) | `21.42% <0.00%> (ø)` | |
| [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `0.00% <0.00%> (ø)` | |
| [remoting/zookeeper/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvem9va2VlcGVyL2xpc3RlbmVyLmdv) | `0.00% <0.00%> (ø)` | |
| [cluster/router/v3router/router\_chain.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9yb3V0ZXIvdjNyb3V0ZXIvcm91dGVyX2NoYWluLmdv) | `39.39% <12.50%> (-2.41%)` | :arrow_down: |
| [remoting/nacos/builder.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3RpbmcvbmFjb3MvYnVpbGRlci5nbw==) | `80.00% <66.66%> (-3.02%)` | :arrow_down: |
| [filter/metrics/filter.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZmlsdGVyL21ldHJpY3MvZmlsdGVyLmdv) | `85.00% <0.00%> (-15.00%)` | :arrow_down: |
| [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `34.43% <0.00%> (-0.67%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [8f207c3...56eb165](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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-commenter edited a comment on pull request #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#issuecomment-992650991
# [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#1665](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2909c83) into [3.0](https://codecov.io/gh/apache/dubbo-go/commit/c4fa4a023076614340e74f343cf7ce2c879fe85a?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c4fa4a0) will **decrease** coverage by `0.21%`.
> The diff coverage is `3.07%`.
> :exclamation: Current head 2909c83 differs from pull request most recent head 77f3730. Consider uploading reports for the commit 77f3730 to get more accurate results
[](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## 3.0 #1665 +/- ##
==========================================
- Coverage 41.36% 41.15% -0.22%
==========================================
Files 255 254 -1
Lines 14664 14621 -43
==========================================
- Hits 6066 6017 -49
- Misses 7899 7905 +6
Partials 699 699
```
| [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [config/consumer\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL2NvbnN1bWVyX2NvbmZpZy5nbw==) | `21.42% <0.00%> (ø)` | |
| [remoting/zookeeper/client.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvem9va2VlcGVyL2NsaWVudC5nbw==) | `0.00% <0.00%> (ø)` | |
| [remoting/zookeeper/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cmVtb3Rpbmcvem9va2VlcGVyL2xpc3RlbmVyLmdv) | `0.00% <0.00%> (ø)` | |
| [cluster/router/v3router/router\_chain.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9yb3V0ZXIvdjNyb3V0ZXIvcm91dGVyX2NoYWluLmdv) | `39.39% <12.50%> (-2.41%)` | :arrow_down: |
| [config/root\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3Jvb3RfY29uZmlnLmdv) | `40.93% <0.00%> (-5.52%)` | :arrow_down: |
| [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `41.37% <0.00%> (-3.45%)` | :arrow_down: |
| [config/registry\_config.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29uZmlnL3JlZ2lzdHJ5X2NvbmZpZy5nbw==) | `18.84% <0.00%> (-1.67%)` | :arrow_down: |
| [cluster/cluster/base/cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2x1c3Rlci9jbHVzdGVyL2Jhc2UvY2x1c3Rlcl9pbnZva2VyLmdv) | `24.17% <0.00%> (-0.27%)` | :arrow_down: |
| [common/url.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3VybC5nbw==) | `61.03% <0.00%> (-0.10%)` | :arrow_down: |
| [protocol/result.go](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHJvdG9jb2wvcmVzdWx0Lmdv) | `0.00% <0.00%> (ø)` | |
| ... and [5 more](https://codecov.io/gh/apache/dubbo-go/pull/1665/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c4fa4a0...77f3730](https://codecov.io/gh/apache/dubbo-go/pull/1665?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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] sanxun0325 commented on a change in pull request #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
sanxun0325 commented on a change in pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#discussion_r771041699
##########
File path: remoting/zookeeper/listener.go
##########
@@ -81,6 +76,56 @@ func (l *ZkEventListener) ListenServiceNodeEvent(zkPath string, listener remotin
}(zkPath, listener)
}
+// ListenConfigurationEvent listen a path node event
+func (l *ZkEventListener) ListenConfigurationEvent(zkPath string, listener remoting.DataListener) {
+ // listen l service node
+ l.wg.Add(1)
+ go func(zkPath string, listener remoting.DataListener) {
+ var eventChan = make(chan zk.Event, 16)
+ l.Client.RegisterEvent(zkPath, eventChan)
+ for {
+ select {
+ case event := <-eventChan:
+ logger.Infof("[ZkEventListener]Receive configuration change event:%#v", event)
+ if event.Type == zk.EventNodeChildrenChanged || event.Type == zk.EventNotWatching {
+ continue
+ }
+ // 1. Re-set watcher for the zk node
+ _, _, _, err := l.Client.Conn.ExistsW(event.Path)
+ if err != nil {
+ logger.Warnf("[ZkEventListener]Re-set watcher error, the reason is %+v", err)
+ }
+
+ action := remoting.EventTypeAdd
+ var content string
+ if event.Type == zk.EventNodeDeleted {
+ action = remoting.EventTypeDel
+ } else {
+ // 2. Try to get new configuration value of the zk node
+ // Notice: The order of step 1 and step 2 cannot be swapped, if you get value(with timestamp t1)
+ // before re-set the watcher(with timestamp t2), and some one change the data of the zk node after
+ // t2 but before t1, you may get the old value, and the new value will not trigger the event.
+ contentBytes, _, err := l.Client.Conn.Get(event.Path)
+ if err != nil {
Review comment:
If an error occurs, need continue execution?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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 #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#issuecomment-1005459233
@Mulavar Check Conflict and I would merge it.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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] Mulavar commented on pull request #1665: refactor zk dynamic configuration listener
Posted by GitBox <gi...@apache.org>.
Mulavar commented on pull request #1665:
URL: https://github.com/apache/dubbo-go/pull/1665#issuecomment-1007092692
> @Mulavar Check Conflict and I would merge it.
finished, thanks.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
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