-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
etcdserver: use context for Renew #6929
Conversation
1928a61
to
2c3ba79
Compare
lgtm. Defer to @xiang90 |
<-ka | ||
|
||
// force keepalive stream message to timeout | ||
clus.Members[1].Stop(t) |
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.
how do we ensure member[0] is not the leader?
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.
quorum loss
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.
leader will stepdown after X seconds I believe, not immediately.
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.
OK, but for the duration it's not going to be able to expire any keys. The test just needs to get a renew failure + lease extension. Maybe this test should be renamed TestLeaseRenewLostQuorum
?
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.
Sure.
if err != nil { | ||
return -1, err | ||
} | ||
req = req.WithContext(ctx) |
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.
does go16 support this?
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.
ugh 3.0 backporting, I'll fix this to do it without it
2c3ba79
to
f7ffbf1
Compare
Giving Renew() the default request timeout causes TestV3LeaseFailover to miss its timing constraints. Since it only needs to wait until the leader recognizes the leader is lost, use RequireLeader to cancel the keepalive stream before the request times out.
Would retry a few times before returning a not primary error that the client should never see. Instead, use proper timeouts and then return a request timeout error on failure. Fixes etcd-io#6922
f7ffbf1
to
be1f36d
Compare
lgtm |
I assume this is to be backported if 1.6 compatibility is important |
Renew would retry a few times before returning a not primary error that
the client should never see. Instead, use proper timeouts and
then return a request timeout error on failure.
Fixes #6922