-
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
clientv3: fix keepalive send interval when response queue is full #9952
Conversation
15fdb5b
to
a876165
Compare
Codecov Report
@@ Coverage Diff @@
## master #9952 +/- ##
=========================================
+ Coverage 69.12% 69.23% +0.1%
=========================================
Files 386 386
Lines 35784 35789 +5
=========================================
+ Hits 24735 24777 +42
+ Misses 9232 9213 -19
+ Partials 1817 1799 -18
Continue to review full report at Codecov.
|
clientv3/integration/lease_test.go
Outdated
// expect lease keepalive every 10-second | ||
lresp, err := lapi.Grant(context.Background(), 30) | ||
if err != nil { | ||
t.Errorf("failed to create lease %v", err) |
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.
you should switch t.errorf and t.fatelf
errorf is to report errors in test, which does not match the test case expectation.
fatalf is to report errors that are not tested in the case, but are failing.
lgtm |
client should update next keepalive send time even when lease keepalive response queue becomes full. Otherwise, client sends keepalive request every 500ms regardless of TTL when the send is only expected to happen with the interval of TTL / 3 at minimum. Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Sorry, I'm late.thanks for fix. @gyuho |
@cfc4n Thanks for report. This will be backported and released with patch release. |
When use etcd keepalive method, we must consume all messages from the queen it retured.Otherwise, the queen would be full. See more detail, visit the follow links: etcd-io/etcd#9952 etcd-io/etcd#8168 https://github.com/coreos/etcd/blob/master/clientv3/concurrency/session.go#L63 https://www.cnxct.com/etcd-lease-keepalive-debug-note/
client should update next keepalive send time
even when lease keepalive response queue becomes full.
Otherwise, client sends keepalive request every 500ms
regardless of TTL when the send is only expected to happen
with the interval of TTL / 3 at minimum.
Fix #9911.
/cc @cfc4n