Explorar o código

fix consistent high timeout err rate caused by prepareStatement (#892)

* fix timeout bug

* remove cache no matter which err returns
Zhixin Wen %!s(int64=8) %!d(string=hai) anos
pai
achega
09f0498f9a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      conn.go

+ 1 - 1
conn.go

@@ -711,8 +711,8 @@ func (c *Conn) prepareStatement(ctx context.Context, stmt string, tracer Tracer)
 
 	framer, err := c.exec(ctx, prep, tracer)
 	if err != nil {
-		flight.err = err
 		flight.wg.Done()
+		c.session.stmtsLRU.remove(stmtCacheKey)
 		return nil, err
 	}