-
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
support sticky connection #270
Conversation
96cae4e
to
3314986
Compare
Codecov Report
@@ Coverage Diff @@
## develop #270 +/- ##
===========================================
- Coverage 66.63% 65.78% -0.86%
===========================================
Files 112 112
Lines 7146 7167 +21
===========================================
- Hits 4762 4715 -47
- Misses 1922 1990 +68
Partials 462 462
Continue to review full report at Codecov.
|
package cluster_impl | ||
|
||
import ( | ||
"context" |
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.
pls split import to 3 blocks as other files.
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.
done~
should stickyInvoker check available? |
5bb5806
to
6e23b28
Compare
yes, i have added this logic. |
565bfb2
to
fab007c
Compare
var selectedInvoker protocol.Invoker | ||
url := invokers[0].GetUrl() | ||
sticky := url.GetParam(constant.STICKY_KEY, "false") | ||
//Get the service method sticky config if have |
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.
GetParamBool
} | ||
|
||
if sticky == "true" && invoker.stickyInvoker != nil && (invoked == nil || !isInvoked(invoker.stickyInvoker, invoked)) { | ||
if invoker.availablecheck && invoker.stickyInvoker.IsAvailable() { |
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 sticky should changed to bool type.
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.
Pls pay attention to change the func: (invoker *baseClusterInvoker) IsAvailable() bool,if stickyInvoker is not nil, base cluster invoker shouldn't check all invokers.
support the sticky connection