See the code:
|
-- get connection from pool |
|
local function conn_get(pool, timeout) |
|
local mysql_conn = pool.queue:get(timeout) |
|
|
|
-- A timeout was reached. |
|
if mysql_conn == nil then return nil end |
|
|
|
local status |
|
if mysql_conn == POOL_EMPTY_SLOT then |
|
status, mysql_conn = driver.connect(pool.host, pool.port or 0, |
|
pool.user, pool.pass, |
|
pool.db, pool.use_numeric_result) |
|
if status < 0 then |
|
return error(mysql_conn) |
|
end |
|
end |
When we got POOL_EMPTY_SLOT from the pool and a connection error occurs, we don't return the slot back to the pool.