-
Notifications
You must be signed in to change notification settings - Fork 78
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
[patch] bugfix ip discoverer disconnection too slow #344
[patch] bugfix ip discoverer disconnection too slow #344
Conversation
Best reviewed: commit by commit
Optimal code review plan
|
704338f
to
e28b46b
Compare
@rinx this PR is ready, could you please review this PR? |
/rebase |
[REBASE] Rebase triggered by kpango for branch: bugfix/gateway-discoverer/ip-discovery-disconnection-too-slow-problem |
Signed-off-by: kpango <i.can.feel.gravity@gmail.com>
e28b46b
to
1df18ea
Compare
[FORMAT] Updating license headers and formatting go codes triggered by kpango. |
Signed-off-by: vdaas-ci <ci@vdaas.org>
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.
LGTM 👍
@@ -201,6 +203,10 @@ func (p *pool) connect(ctx context.Context) (c Conn, err error) { | |||
log.Debugf("establishing same connection to %s", p.addr) | |||
conn, err := p.dial(ctx, p.addr) | |||
if err != nil { | |||
failCnt++ | |||
if p.isIP && (p.Len() <= 2 || failCnt >= p.Len()/3) { |
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.
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.
If the IP connection fails, that is, the target IP is invalid or missing, or there is a network failure, you need to consider it. If there are less than two pool connections or 30% of the pool should immediately return an error.
Co-Authored-By: Rintaro Okamura <rintaro.okamura@gmail.com>
/approve |
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.
[APPROVED] This PR is approved by rinx.
Signed-off-by: kpango i.can.feel.gravity@gmail.com
Description:
Discoverer client auto connects new founded remote origin but doesn't close old connection at that time, discovery client disconnects their connection during rebalance conn or health check conn, it makes problem for IP discovery connection pool client like gateway-agent connection, so I added disconnection logic when discovery new remotes.
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: