Skip to content

Commit

Permalink
close call.timeout to prevent deadlock. fixes apache#664
Browse files Browse the repository at this point in the history
if a successful response is recieve at the same time as the 10th
timeout, a deadlock can occur if succesfull response is read
from the response channel before closeWithError send an error
of response channel. By closing the call.timeout after reading
from the response channel we can avoid this deadlock.
  • Loading branch information
woodsaj committed Mar 8, 2016
1 parent 15590c2 commit a405102
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ func (c *Conn) exec(req frameWriter, tracer Tracer) (*framer, error) {

select {
case err := <-call.resp:
close(call.timeout)
if err != nil {
if !c.Closed() {
// if the connection is closed then we cant release the stream,
Expand Down

0 comments on commit a405102

Please sign in to comment.