فهرست منبع

close call.timeout to prevent deadlock. fixes #664

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.
woodsaj 10 سال پیش
والد
کامیت
a4051028e5
1فایلهای تغییر یافته به همراه1 افزوده شده و 0 حذف شده
  1. 1 0
      conn.go

+ 1 - 0
conn.go

@@ -570,6 +570,7 @@ func (c *Conn) exec(req frameWriter, tracer Tracer) (*framer, error) {
 
 
 	select {
 	select {
 	case err := <-call.resp:
 	case err := <-call.resp:
+		close(call.timeout)
 		if err != nil {
 		if err != nil {
 			if !c.Closed() {
 			if !c.Closed() {
 				// if the connection is closed then we cant release the stream,
 				// if the connection is closed then we cant release the stream,