internal: log when connection is closed due to keepalive (#2940)

This commit is contained in:
Menghan Li
2019-07-29 14:33:10 -07:00
committed by GitHub
parent 120728e1f7
commit a4f24690a4
2 changed files with 3 additions and 0 deletions

View File

@ -1332,6 +1332,7 @@ func (t *http2Client) keepalive() {
timer.Reset(t.kp.Time)
continue
}
infof("transport: closing client transport due to idleness.")
t.Close()
return
case <-t.ctx.Done():

View File

@ -965,6 +965,7 @@ func (t *http2Server) keepalive() {
select {
case <-maxAge.C:
// Close the connection after grace period.
infof("transport: closing server transport due to maximum connection age.")
t.Close()
// Resetting the timer so that the clean-up doesn't deadlock.
maxAge.Reset(infinity)
@ -978,6 +979,7 @@ func (t *http2Server) keepalive() {
continue
}
if pingSent {
infof("transport: closing server transport due to idleness.")
t.Close()
// Resetting the timer so that the clean-up doesn't deadlock.
keepalive.Reset(infinity)