-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/direct notify #995
Feat/direct notify #995
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
25c3b98
to
9a666eb
Compare
// look up at: | ||
// remoting/getty/listener.go | ||
// registry/directory/directory.go | ||
var DirMap sync.Map |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's the best way to achieve the direct notify from remoting.session to directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find another way to link this two pkg. As there may be unexpected loop refer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请允许我使用中文,关于这个问题,我先说一下我的看法。
先看一下现在的结构,我没理解错应该是:
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我仔细想了想,这里的确有问题。
我写这个pr的是以:“这个session一旦被关闭,证明server端就一定关闭了”为前提的。一旦session因为网络抖动出现了err,会直接删除掉dir的cache,这样设计不太合理。
我先表述一下这个pr的初衷:是为了提高客户端对于server端下线的感知速度:不只通过regisgtry感知,而是通过session感知。如果判断窗口期请求,我觉得是不太现实,因为这个时间可能registry都通知过来了。
感觉这个需求可能有点问题。
另一方面,我的另一个pr:#976
有提供invoke前的健康检查机制,感觉这两个pr在功能上是有重复的,我和展图讨论下。
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:
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?:
NONE