Connection pool management uses two layer of poolboy pools.
request_pool (128) -------+
|
+----> pbc_pool_master (133)
|
bucket_list_pool (5) -----+
(rcs-dev1@127.0.0.1)1> [{P, poolboy:status(P)} || P <- [request_pool, bucket_list_pool, pbc_pool_master]].
[{request_pool,{ready,128,0,0}},
{bucket_list_pool,{ready,5,0,0}},
{pbc_pool_master,{ready,133,0,0}}]
(rcs-dev1@127.0.0.1)2> f(), spawn(fun() ->
{ok, RcPid} = riak_cs_riak_client:start_link([]),
riak_cs_riak_client:manifest_pbc(RcPid),
spawn_link(fun() -> exit(dummY)
end) end).
<0.504.0>
(rcs-dev1@127.0.0.1)3> [{P, poolboy:status(P)} || P <- [request_pool, bucket_list_pool, pbc_pool_master]].
[{request_pool,{ready,128,0,0}},
{bucket_list_pool,{ready,5,0,0}},
{pbc_pool_master,{ready,132,0,1}}] %% <==== LEAK!!
Connection pool management uses two layer of poolboy pools.
In default settings, the relation of pool and thier size are as follows:
UPDATE As descripbed in the comment below #985 (comment), this steps may not be essential.
Steps to reproduce (or emulate) the leak at
pbc_pool_master.The process which calls
riak_cs_riak_client:start_link/1 emulatesriak_cs_gc_d. The one which callsexit(dummY)` emulates other GCrelated process, for example riak_cs_put_fsm or riak_cs_delete_server.