OpenRiak / riak_kv

Riak Key/Value Store
0 stars 0 forks source link

Peer crashing if sink disabled #9

Open martinsumner opened 1 year ago

martinsumner commented 1 year ago

When a riak_kv_replrtq_snk is disabled, but riak_kv_replrtq_peer is not, then the peer will crash when it receives undefined in response to riak_kv_replrtq_snk:current_peers/1

2023-09-18 13:54:16 =CRASH REPORT====
  crasher:
    initial call: riak_kv_replrtq_peer:init/1
    pid: <0.29834.163>
    registered_name: riak_kv_replrtq_peer
    exception error: {function_clause,[{lists,map,[#Fun<riak_kv_replrtq_peer.2.59601804>,undefined],[{file,"lists.erl"},{line,1238}]},{riak_kv_replrtq_peer,do_discovery,3,[{file,"/home/ubuntu/nhs-riak/rel/pkg/out/riak-3.0.17-nhse-OTP22.3/_build/default/lib/riak_kv/src/riak_kv_replrtq_peer.erl"},{line,195}]},{riak_kv_replrtq_peer,handle_cast,2,[{file,"/home/ubuntu/nhs-riak/rel/pkg/out/riak-3.0.17-nhse-OTP22.3/_build/default/lib/riak_kv/src/riak_kv_replrtq_peer.erl"},{line,128}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,637}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,711}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}
martinsumner commented 1 year ago

Directly resolving this by returning an empty list has unexpected consequences. The peer may then re-add the sink queue work which could override the suspension or disabling of the snk.