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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to