Skip to content

Commit

Permalink
Merge pull request #456 from makasim/fix-leaked-reader-goroutine
Browse files Browse the repository at this point in the history
c.reader() not always exit on c.Close()
  • Loading branch information
michaelklishin authored Jul 16, 2020
2 parents 3a5c3a9 + 4844cbe commit e6b33f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,12 @@ func (c *Connection) reader(r io.Reader) {
c.demux(frame)

if haveDeadliner {
c.deadlines <- conn
select {
case c.deadlines <- conn:
default:
// On c.Close() c.heartbeater() might exit just before c.deadlines <- conn is called.
// Which results in this goroutine being stuck forever.
}
}
}
}
Expand Down

0 comments on commit e6b33f4

Please sign in to comment.