Skip to content

Commit 3693085

Browse files
committed
add debug logs to request time out
1 parent 89a8201 commit 3693085

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
@@ -1140,12 +1140,19 @@ func (c *Conn) exec(ctx context.Context, req frameBuilder, tracer Tracer) (*fram
11401140
return resp.framer, nil
11411141
case <-timeoutCh:
11421142
close(call.timeout)
1143+
c.logger.Debug("Request timed out on connection %v (%v)",
1144+
NewLogField("host_id", c.host.HostID()), NewLogField("addr", c.host.ConnectAddress()))
11431145
c.handleTimeout()
11441146
return nil, ErrTimeoutNoResponse
11451147
case <-ctxDone:
1148+
c.logger.Debug("Request failed because context elapsed out on connection %v (%v): %v",
1149+
NewLogField("host_id", c.host.HostID()), NewLogField("addr", c.host.ConnectAddress()),
1150+
NewLogField("ctx_err", ctx.Err().Error()))
11461151
close(call.timeout)
11471152
return nil, ctx.Err()
11481153
case <-c.ctx.Done():
1154+
c.logger.Debug("Request failed because connection closed %v (%v).",
1155+
NewLogField("host_id", c.host.HostID()), NewLogField("addr", c.host.ConnectAddress()))
11491156
close(call.timeout)
11501157
return nil, ErrConnectionClosed
11511158
}

0 commit comments

Comments
 (0)