Skip to content

Commit

Permalink
ignore errors returned by SetKeepAlive (go-sql-driver#1448)
Browse files Browse the repository at this point in the history
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
  • Loading branch information
achille-roussel committed Jun 13, 2023
1 parent cf948e4 commit 943264b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ func (c *connector) Connect(ctx context.Context) (driver.Conn, error) {
// Enable TCP Keepalives on TCP connections
if tc, ok := mc.netConn.(*net.TCPConn); ok {
if err := tc.SetKeepAlive(true); err != nil {
// Don't send COM_QUIT before handshake.
mc.netConn.Close()
mc.netConn = nil
return nil, err
c.cfg.Logger.Print(err)
}
}

Expand Down

0 comments on commit 943264b

Please sign in to comment.