Closed
Description
Issue description
when i specially use a unavailable mysql server address to test PingContext, PingContext not cancel when ctx deadline, and every time it will cost 21 seconds when return error of " dial tcp 192.168.31.123:3306: connect: connection refused", but it should return error of "context canceled" after my ctx timeout.
Example code
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(3)*time.Second)
defer cancel()
err = db.PingContext(ctx)
if err != nil {
return
}
Metadata
Metadata
Assignees
Labels
No labels