Skip to content

Commit d6b8906

Browse files
author
wmin0
committed
close bad connection to solve CLOSE_WAIT stuck
1 parent 88edab0 commit d6b8906

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

error.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,4 +506,8 @@ func (c *conn) errRecover(err *error) {
506506
if *err == driver.ErrBadConn {
507507
c.bad = true
508508
}
509+
510+
if c.bad && c.c != nil {
511+
c.c.Close()
512+
}
509513
}

0 commit comments

Comments
 (0)