فهرست منبع

conn: fix potential framer reuse in prepare (#1112)

Don't put the framer into the pool when we may return it on the iter which when closed will return it to the pool.
Chris Bannister 7 سال پیش
والد
کامیت
ed13cda9d6
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      conn.go

+ 1 - 2
conn.go

@@ -1107,9 +1107,8 @@ func (c *Conn) executeBatch(batch *Batch) *Iter {
 			c.session.stmtsLRU.remove(key)
 		}
 
-		framerPool.Put(framer)
-
 		if found {
+			framerPool.Put(framer)
 			return c.executeBatch(batch)
 		} else {
 			return &Iter{err: x, framer: framer}