Skip to content

Commit f782f52

Browse files
committed
add debug logs to request time out
1 parent 24828c8 commit f782f52

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

conn.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,12 +1318,19 @@ func (c *Conn) execInternal(ctx context.Context, req frameBuilder, tracer Tracer
13181318
return resp.framer, nil
13191319
case <-timeoutCh:
13201320
close(call.timeout)
1321+
c.logger.Debug("Request timed out on connection %v (%v)",
1322+
NewLogField("host_id", c.host.HostID()), NewLogField("addr", c.host.ConnectAddress()))
13211323
c.handleTimeout()
13221324
return nil, ErrTimeoutNoResponse
13231325
case <-ctxDone:
1326+
c.logger.Debug("Request failed because context elapsed out on connection %v (%v): %v",
1327+
NewLogField("host_id", c.host.HostID()), NewLogField("addr", c.host.ConnectAddress()),
1328+
NewLogField("ctx_err", ctx.Err().Error()))
13241329
close(call.timeout)
13251330
return nil, ctx.Err()
13261331
case <-c.ctx.Done():
1332+
c.logger.Debug("Request failed because connection closed %v (%v).",
1333+
NewLogField("host_id", c.host.HostID()), NewLogField("addr", c.host.ConnectAddress()))
13271334
close(call.timeout)
13281335
return nil, ErrConnectionClosed
13291336
}

0 commit comments

Comments
 (0)