You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a race condition in the riak_kv_js_manager wherein:
A process (e.g. a pipe fitter) calls riak_kv_js_manager:blocking_dispatch/4
riak_kv_js_manager:blocking_dispatch function calls reserve_vm, a gen_server:call to the riak_kv_js_manager, which reserves a VM
The calling process (e.g. a pipe fitting) is killed before calling riak_kv_js_vm:blocking_dispatch/3, a gen_server:call to the riak_kv_js_manager, which normally would return the JS VM to the VM pool after successfully running the provided JS
In this situation, the reserved JS VM will never be returned to the JS VM pool.
The offending code is as follows:
blocking_dispatch(Name, JSCall, MaxCount, Count) ->casereserve_vm(Name) of%% reserve_vm is a gen_server:call to the riak_kv_js_manager
{ok, VM} ->
JobId= {VM, make_ref()},
riak_kv_js_vm:blocking_dispatch(VM, JobId, JSCall); %% riak_kv_js_vm:blocking_dispatch is a gen_server:call to the riak_kv_js_vm
{error, no_vms} ->
back_off(MaxCount, Count),
blocking_dispatch(Name, JSCall, MaxCount, Count-1)
end.
The simple solution would appear to be linking the calling process to the JS VM before allowing it to be checkout of the pool.
The text was updated successfully, but these errors were encountered:
There is a race condition in the
riak_kv_js_manager
wherein:riak_kv_js_manager:blocking_dispatch/4
riak_kv_js_manager:blocking_dispatch
function callsreserve_vm
, agen_server:call
to theriak_kv_js_manager
, which reserves a VMriak_kv_js_vm:blocking_dispatch/3
, agen_server:call
to theriak_kv_js_manager
, which normally would return the JS VM to the VM pool after successfully running the provided JSIn this situation, the reserved JS VM will never be returned to the JS VM pool.
The offending code is as follows:
The simple solution would appear to be linking the calling process to the JS VM before allowing it to be checkout of the pool.
The text was updated successfully, but these errors were encountered: