30
30
-- channel put is immediate or pool is doomed.
31
31
local CONN_GC_HOOK_TIMEOUT = 0
32
32
33
- local function conn_gc_hook (pool , conn )
33
+ local function conn_gc_hook (pool , conn_id )
34
34
local success = pool .queue :put (POOL_EMPTY_SLOT , CONN_GC_HOOK_TIMEOUT )
35
35
if not success then
36
36
log .error (' mysql pool %s internal queue unexpected state: there are no ' ..
37
37
' empty slots, connection %s cannot be put back. It is likely ' ..
38
38
' that someone had messed with pool.queue manually. Closing ' ..
39
- ' the pool...' , pool , conn )
39
+ ' the pool...' , pool , conn_id )
40
40
log .error (debug.traceback )
41
41
42
42
pool :close ()
@@ -62,6 +62,7 @@ local function conn_get(pool, timeout)
62
62
end
63
63
64
64
local conn = conn_create (mysql_conn )
65
+ local conn_id = tostring (conn )
65
66
-- we can use ffi gc to return mysql connection to pool
66
67
conn .__gc_hook = ffi .gc (ffi .new (' void *' ),
67
68
function (self )
@@ -71,7 +72,7 @@ local function conn_get(pool, timeout)
71
72
-- * 2.5.1-105-gc690b3337
72
73
-- * 2.4.2-89-g83037df15
73
74
-- * 1.10.7-47-g8099cb053
74
- fiber .new (conn_gc_hook , pool , conn )
75
+ fiber .new (conn_gc_hook , pool , conn_id )
75
76
end )
76
77
-- If the connection belongs to a connection pool, it must be returned to
77
78
-- the pool when calling "close" without actually closing the connection.
0 commit comments