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/01/13 06:35:17 UTC

[GitHub] [dubbo-go] LaurenceLiZhixin opened a new pull request #995: Feat/direct notify

LaurenceLiZhixin opened a new pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995


   <!--  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**:
   This pr does: when provider is close, it notify consumer through getty-session, not only  notified by registry.
   This is quicker for consumer to delete target invoker in directory. 
   
   **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**:
   I add a common sync.Map in common/dubbo_dir_refresh.go, which links dubbo-getty and registryDirectory. 
   when session is on close or on errror, it call dir.Notify(deleteEvent) to refresh quickly.
   
   **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".
   -->
   NONE
   ```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.

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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r563263300



##########
File path: common/dubbo_dir_refresh.go
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import "sync"
+
+// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session
+// look up at:
+// remoting/getty/listener.go
+// registry/directory/directory.go
+var DirMap sync.Map

Review comment:
       I can't find another way to link this two pkg. As there may be unexpected loop refer.




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r563244740



##########
File path: common/dubbo_dir_refresh.go
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import "sync"
+
+// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session
+// look up at:
+// remoting/getty/listener.go
+// registry/directory/directory.go
+var DirMap sync.Map

Review comment:
       Why use public variable in this module? Although you have comment in this variable,but It can be used in all modules in dubbo-go.Even the module out of dubbo-go.




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#issuecomment-759965410


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=h1) Report
   > Merging [#995](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=desc) (79333de) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/794ab77916f1cc60fb5ab6a988ae4c4bfa1b2eaa?el=desc) (794ab77) will **increase** coverage by `0.39%`.
   > The diff coverage is `61.90%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/995/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #995      +/-   ##
   ===========================================
   + Coverage    59.20%   59.60%   +0.39%     
   ===========================================
     Files          261      261              
     Lines        12919    12934      +15     
   ===========================================
   + Hits          7649     7709      +60     
   + Misses        4304     4251      -53     
   - Partials       966      974       +8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `77.27% <28.57%> (-1.70%)` | :arrow_down: |
   | [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `63.51% <75.00%> (+0.16%)` | :arrow_up: |
   | [remoting/getty/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvbGlzdGVuZXIuZ28=) | `42.48% <77.77%> (+1.40%)` | :arrow_up: |
   | [remoting/getty/getty\_client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvZ2V0dHlfY2xpZW50Lmdv) | `44.30% <100.00%> (ø)` | |
   | [metadata/report/delegate/delegate\_report.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-bWV0YWRhdGEvcmVwb3J0L2RlbGVnYXRlL2RlbGVnYXRlX3JlcG9ydC5nbw==) | `28.00% <0.00%> (-9.61%)` | :arrow_down: |
   | [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `72.05% <0.00%> (-2.95%)` | :arrow_down: |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `76.92% <0.00%> (ø)` | |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `50.52% <0.00%> (ø)` | |
   | [cluster/cluster\_impl/failback\_cluster\_invoker.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9jbHVzdGVyX2ltcGwvZmFpbGJhY2tfY2x1c3Rlcl9pbnZva2VyLmdv) | `75.90% <0.00%> (+2.40%)` | :arrow_up: |
   | [remoting/kubernetes/registry\_controller.go](https://codecov.io/gh/apache/dubbo-go/pull/995/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/995/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?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/995?src=pr&el=footer). Last update [794ab77...e9f044e](https://codecov.io/gh/apache/dubbo-go/pull/995?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 a change in pull request #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r563263199



##########
File path: common/dubbo_dir_refresh.go
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import "sync"
+
+// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session
+// look up at:
+// remoting/getty/listener.go
+// registry/directory/directory.go
+var DirMap sync.Map

Review comment:
       I think it's the best way to achieve the direct notify from remoting.session to directory




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r559094517



##########
File path: registry/directory/directory.go
##########
@@ -233,6 +233,20 @@ func (dir *RegistryDirectory) setNewInvokers() {
 	dir.RouterChain().SetInvokers(newInvokers)
 }
 
+// AddToDirMap is called after receive Add event
+// this function add a way to delete service in directory directory by getty-session, not only by registry

Review comment:
       "directory directory"? duplicated?




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#issuecomment-759965410


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=h1) Report
   > Merging [#995](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=desc) (c82a70f) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/794ab77916f1cc60fb5ab6a988ae4c4bfa1b2eaa?el=desc) (794ab77) will **increase** coverage by `0.50%`.
   > The diff coverage is `59.09%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/995/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #995      +/-   ##
   ===========================================
   + Coverage    59.20%   59.70%   +0.50%     
   ===========================================
     Files          261      261              
     Lines        12919    12928       +9     
   ===========================================
   + Hits          7649     7719      +70     
   + Misses        4304     4232      -72     
   - Partials       966      977      +11     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `67.96% <0.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `73.07% <ø> (+2.70%)` | :arrow_up: |
   | [cluster/router/tag/tag\_router.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvdGFnL3RhZ19yb3V0ZXIuZ28=) | `73.84% <ø> (+1.25%)` | :arrow_up: |
   | [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `77.27% <28.57%> (-1.70%)` | :arrow_down: |
   | [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `63.51% <75.00%> (+0.16%)` | :arrow_up: |
   | [remoting/getty/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvbGlzdGVuZXIuZ28=) | `42.48% <77.77%> (+1.40%)` | :arrow_up: |
   | [remoting/getty/getty\_client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvZ2V0dHlfY2xpZW50Lmdv) | `44.30% <100.00%> (ø)` | |
   | [remoting/kubernetes/client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9jbGllbnQuZ28=) | `72.05% <0.00%> (-2.95%)` | :arrow_down: |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `74.72% <0.00%> (-2.20%)` | :arrow_down: |
   | [remoting/kubernetes/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy9saXN0ZW5lci5nbw==) | `50.52% <0.00%> (ø)` | |
   | ... and [6 more](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?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/995?src=pr&el=footer). Last update [794ab77...87c1321](https://codecov.io/gh/apache/dubbo-go/pull/995?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] AlexStocks commented on a change in pull request #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
AlexStocks commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r559094662



##########
File path: remoting/getty/listener.go
##########
@@ -85,15 +90,25 @@ func (h *RpcClientHandler) OnOpen(session getty.Session) error {
 // OnError the getty client session has errored, so remove the session from the getty client session list
 func (h *RpcClientHandler) OnError(session getty.Session, err error) {
 	logger.Infof("session{%s} got error{%v}, will be closed.", session.Stat(), err)
+	h.tryDirectlyDelete()
 	h.conn.removeSession(session)
 }
 
 // OnClose close the session, remove it from the getty session list
 func (h *RpcClientHandler) OnClose(session getty.Session) {
 	logger.Infof("session{%s} is closing......", session.Stat())
+	h.tryDirectlyDelete()
 	h.conn.removeSession(session)
 }
 
+func (h *RpcClientHandler) tryDirectlyDelete() {

Review comment:
       change this func name to tryDirectDelete or tryDeleteDirectly.




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#issuecomment-759965410


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=h1) Report
   > Merging [#995](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=desc) (c82a70f) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/cc3e8d608571c47c0e02330d3a15011b4427cf0e?el=desc) (cc3e8d6) will **increase** coverage by `0.04%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/995/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #995      +/-   ##
   ===========================================
   + Coverage    59.66%   59.70%   +0.04%     
   ===========================================
     Files          261      261              
     Lines        12920    12928       +8     
   ===========================================
   + Hits          7709     7719      +10     
   + Misses        4240     4232       -8     
   - Partials       971      977       +6     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `67.96% <0.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `73.07% <ø> (+2.70%)` | :arrow_up: |
   | [cluster/router/tag/tag\_router.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvdGFnL3RhZ19yb3V0ZXIuZ28=) | `73.84% <ø> (+1.25%)` | :arrow_up: |
   | [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `77.27% <28.57%> (-1.70%)` | :arrow_down: |
   | [config\_center/file/impl.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9maWxlL2ltcGwuZ28=) | `50.42% <42.85%> (-0.43%)` | :arrow_down: |
   | [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `63.51% <75.00%> (+0.16%)` | :arrow_up: |
   | [remoting/getty/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvbGlzdGVuZXIuZ28=) | `42.48% <77.77%> (+1.40%)` | :arrow_up: |
   | [registry/file/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZmlsZS9zZXJ2aWNlX2Rpc2NvdmVyeS5nbw==) | `45.74% <100.00%> (ø)` | |
   | [remoting/getty/getty\_client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvZ2V0dHlfY2xpZW50Lmdv) | `44.30% <100.00%> (ø)` | |
   | [remoting/kubernetes/watch.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3Rpbmcva3ViZXJuZXRlcy93YXRjaC5nbw==) | `74.72% <0.00%> (-4.40%)` | :arrow_down: |
   | ... and [6 more](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?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/995?src=pr&el=footer). Last update [5cb723a...dad63a5](https://codecov.io/gh/apache/dubbo-go/pull/995?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] AlexStocks closed pull request #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
AlexStocks closed pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995


   


----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
LaurenceLiZhixin commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r566812143



##########
File path: common/dubbo_dir_refresh.go
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import "sync"
+
+// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session
+// look up at:
+// remoting/getty/listener.go
+// registry/directory/directory.go
+var DirMap sync.Map

Review comment:
       我仔细想了想,这里的确有问题。
   我写这个pr的是以:“这个session一旦被关闭,证明server端就一定关闭了”为前提的。一旦session因为网络抖动出现了err,会直接删除掉dir的cache,这样设计不太合理。
   我先表述一下这个pr的初衷:是为了提高客户端对于server端下线的感知速度:不只通过regisgtry感知,而是通过session感知。如果判断窗口期请求,我觉得是不太现实,因为这个时间可能registry都通知过来了。
   感觉这个需求可能有点问题。
   另一方面,我的另一个pr:https://github.com/apache/dubbo-go/pull/976
   有提供invoke前的健康检查机制,感觉这两个pr在功能上是有重复的,我和展图讨论下。




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r564187543



##########
File path: common/dubbo_dir_refresh.go
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import "sync"
+
+// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session
+// look up at:
+// remoting/getty/listener.go
+// registry/directory/directory.go
+var DirMap sync.Map

Review comment:
       请允许我使用中文,关于这个问题,我先说一下我的看法。
   先看一下现在的结构,我没理解错应该是:
   invoker-》client-》getty pool-》session(connection)
   现在是直接加在 session 的 close/error 上。
   
   针对这个 PR,我有以下几个疑问:
   * 这个功能是否应该加在 invoker / client ?为什么我这么说?请看第二个问题。
   * 因为有可能有 10 个 connection,其中 n ( n < 10 )个因为网络抖动连不上,然后就去删除 DIr 中的 cache?这也可能和第三个问题有关联。
   * 我只看到在 session(connection)上删除,但是我没看到如何加回去?
   * 如果按照现在的套路,如果 n ( n > 1) 个 registry 要加回去,是不是会造成:频繁增加。
   
   我的建议是:
   调整到 invoekr 或者 client,通过判断窗口期中多少个请求失败,再触发删除 cache,最后记得加上恢复 registry 的代码。
   但是如果按照我的建议做的话,是否能基于:ActiveFilter?




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
zouyx commented on a change in pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#discussion_r564187543



##########
File path: common/dubbo_dir_refresh.go
##########
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common
+
+import "sync"
+
+// DirMap is used by dubbo-getty, it can notify delete event to dubbo directory directly by getty session
+// look up at:
+// remoting/getty/listener.go
+// registry/directory/directory.go
+var DirMap sync.Map

Review comment:
       请允许我使用中文,关于这个问题,我先说一下我的看法。
   先看一下现在的结构,我没理解错应该是:
   invoker-》client-》getty pool-》session(connection)
   现在是直接加在 session 的 close/error 上。
   
   针对这个 PR,我有以下几个疑问:
   * 这个功能是否应该加在 invoker / client ?为什么我这么说?请看第二个问题。
   * 因为有可能有 10 个 connection,其中 n ( n < 10 )个因为网络抖动连不上,然后就去删除 DIr 中的 cache?这也可能和第三个问题有关联。
   * 我只看到在 session(connection)上删除,但是我没看到如何加回去?
   * 如果按照现在的套路,如果 n ( n > 1) 个 registry 要加回去,是不是会造成:频繁增加。
   
   我的建议是:
   调整到 invoekr 或者 client,通过判断窗口期中多少个请求失败,再触发删除 cache,最后记得加上恢复 registry 的代码。
   但是如果按照我的建议做的话,是否能基于:ActiveFilter?




----------------------------------------------------------------
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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#issuecomment-759965410


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=h1) Report
   > Merging [#995](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=desc) (dad63a5) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/cc3e8d608571c47c0e02330d3a15011b4427cf0e?el=desc) (cc3e8d6) will **increase** coverage by `0.01%`.
   > The diff coverage is `50.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/995/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #995      +/-   ##
   ===========================================
   + Coverage    59.66%   59.68%   +0.01%     
   ===========================================
     Files          261      261              
     Lines        12920    12928       +8     
   ===========================================
   + Hits          7709     7716       +7     
   - Misses        4240     4241       +1     
     Partials       971      971              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `67.96% <0.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `73.07% <ø> (+2.70%)` | :arrow_up: |
   | [cluster/router/tag/tag\_router.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvdGFnL3RhZ19yb3V0ZXIuZ28=) | `73.84% <ø> (+1.25%)` | :arrow_up: |
   | [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `77.27% <28.57%> (-1.70%)` | :arrow_down: |
   | [config\_center/file/impl.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y29uZmlnX2NlbnRlci9maWxlL2ltcGwuZ28=) | `50.42% <42.85%> (-0.43%)` | :arrow_down: |
   | [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `63.51% <75.00%> (+0.16%)` | :arrow_up: |
   | [remoting/getty/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvbGlzdGVuZXIuZ28=) | `42.48% <77.77%> (+1.40%)` | :arrow_up: |
   | [registry/file/service\_discovery.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZmlsZS9zZXJ2aWNlX2Rpc2NvdmVyeS5nbw==) | `45.74% <100.00%> (ø)` | |
   | [remoting/getty/getty\_client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvZ2V0dHlfY2xpZW50Lmdv) | `44.30% <100.00%> (ø)` | |
   | ... and [1 more](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?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/995?src=pr&el=footer). Last update [5cb723a...dad63a5](https://codecov.io/gh/apache/dubbo-go/pull/995?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 #995: Feat/direct notify

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #995:
URL: https://github.com/apache/dubbo-go/pull/995#issuecomment-759965410


   # [Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=h1) Report
   > Merging [#995](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=desc) (dad63a5) into [develop](https://codecov.io/gh/apache/dubbo-go/commit/0cb6edb4dd989696cc56b10259b1e0a146f1c54d?el=desc) (0cb6edb) will **increase** coverage by `0.02%`.
   > The diff coverage is `59.09%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/dubbo-go/pull/995/graphs/tree.svg?width=650&height=150&src=pr&token=dcPE6RyFAL)](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           develop     #995      +/-   ##
   ===========================================
   + Coverage    59.66%   59.68%   +0.02%     
   ===========================================
     Files          261      261              
     Lines        12919    12928       +9     
   ===========================================
   + Hits          7708     7716       +8     
   - Misses        4240     4241       +1     
     Partials       971      971              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dubbo-go/pull/995?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [cluster/router/chain/chain.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvY2hhaW4vY2hhaW4uZ28=) | `67.96% <0.00%> (ø)` | |
   | [cluster/router/healthcheck/health\_check\_route.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvaGVhbHRoY2hlY2svaGVhbHRoX2NoZWNrX3JvdXRlLmdv) | `73.07% <ø> (+2.70%)` | :arrow_up: |
   | [cluster/router/tag/tag\_router.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-Y2x1c3Rlci9yb3V0ZXIvdGFnL3RhZ19yb3V0ZXIuZ28=) | `73.84% <ø> (+1.25%)` | :arrow_up: |
   | [registry/directory/directory.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVnaXN0cnkvZGlyZWN0b3J5L2RpcmVjdG9yeS5nbw==) | `77.27% <28.57%> (-1.70%)` | :arrow_down: |
   | [remoting/getty/pool.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvcG9vbC5nbw==) | `63.51% <75.00%> (+0.16%)` | :arrow_up: |
   | [remoting/getty/listener.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvbGlzdGVuZXIuZ28=) | `42.48% <77.77%> (+1.40%)` | :arrow_up: |
   | [remoting/getty/getty\_client.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cmVtb3RpbmcvZ2V0dHkvZ2V0dHlfY2xpZW50Lmdv) | `44.30% <100.00%> (ø)` | |
   | [...tocol/rest/server/server\_impl/go\_restful\_server.go](https://codecov.io/gh/apache/dubbo-go/pull/995/diff?src=pr&el=tree#diff-cHJvdG9jb2wvcmVzdC9zZXJ2ZXIvc2VydmVyX2ltcGwvZ29fcmVzdGZ1bF9zZXJ2ZXIuZ28=) | `48.78% <0.00%> (+4.87%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/dubbo-go/pull/995?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/995?src=pr&el=footer). Last update [9a666eb...11b1a19](https://codecov.io/gh/apache/dubbo-go/pull/995?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