Преглед на файлове

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}