-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(consul): unable to recreate after canceled the consul watch #3162
Conversation
When the idle mode ends, watch again does not continue to obtain the instance list of the service through consul. |
8a3411a
to
0cb74ea
Compare
Can it be fixed when multiple clients are created for the same service? For example, if a client is idle, will b client also be unable to update the instance due to Watcher shutdown? kratos/contrib/registry/consul/watcher.go Line 34 in 0cb74ea
|
If you are talking about multiple grpc clients, then each client will build a different resolver to watch name resolution updates. Each resolver has its own context to control the shutdown of the Watcher. Therefore, when client a becomes idle, client b will not close the watcher. When creating the grpc client, a resolver will be built:
|
0cb74ea
to
2980638
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3162 +/- ##
==========================================
+ Coverage 84.62% 84.72% +0.10%
==========================================
Files 88 88
Lines 3993 3993
==========================================
+ Hits 3379 3383 +4
+ Misses 440 438 -2
+ Partials 174 172 -2 ☔ View full report in Codecov by Sentry. |
07fa9fa
to
764ddc2
Compare
764ddc2
to
2772307
Compare
e6b07ce
to
e7467e7
Compare
…est instance of the service * Add test cases * Delete serviceSet when serviceSet has no watcher * The context of resolve is controlled independently * resolve use set context * Remove test declare and do not use it * gofmt * golangci-lint fix
e7467e7
to
7437ac0
Compare
Description (what this PR does / why we need it):
Which issue(s) this PR fixes (resolves / be part of):
Other special notes for the reviewers: