فهرست منبع

When the hostpool is empty dont block in fill

If the host is down and its connect blocks until timeout the
caller should not be blocked because it may be coming from a call
to execute a query.
Chris Bannister 11 سال پیش
والد
کامیت
5db16e32cc
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      connectionpool.go

+ 2 - 1
connectionpool.go

@@ -679,7 +679,8 @@ func (pool *hostConnPool) Pick(qry *Query) *Conn {
 
 
 	if empty {
 	if empty {
 		// try to fill the empty pool
 		// try to fill the empty pool
-		pool.fill()
+		go pool.fill()
+		return nil
 	}
 	}
 
 
 	return pool.policy.Pick(qry)
 	return pool.policy.Pick(qry)