go client reports invalid connection
after idle for wait_timeout
#327
Labels
wontfix
This will not be worked on
invalid connection
after idle for wait_timeout
#327
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
The driver logs
packets.go:122: closing bad idle connection: EOF
3 times butdbt.db.Begin
doesn't report any errors because it creates a new connection internally and then retry.3. What did you see instead (Required)
The driver logs
packets.go:37: unexpected EOF
anddbt.db.Begin
reportsinvalid connection
.4. What is your version? (Required)
master.
The reason:
TiProxy doesn't close the connection immediately after
wait_timeout
and still receives requests. After it receives the request, it finds that TiDB has disconnected and then closes the client connection. So the client encounters anErrInvalidConn
inreadPacket
instead ofErrBadConn
inwritePacket
.The client will retry by creating a new connection if encounters
ErrBadConn
but won't retry if encountersErrInvalidConn
, see https://github.com/golang/go/blob/master/src/database/sql/sql.go#L1536-1546I think there's no way to solve it.
The text was updated successfully, but these errors were encountered: