uwiger / gproc

Extended process registry for Erlang
Apache License 2.0
1.07k stars 232 forks source link

Generic server gproc terminating on reg #161

Closed NoobsEnslaver closed 6 years ago

NoobsEnslaver commented 6 years ago

Call gproc:reg({rc, l, ResName}), get gproc gen_server crash

ERROR REPORT Generic server gproc terminating
 Last message in was {reg,{rc,l,{interface,<<"ams02-access-hp">>}},undefined,[],reg}
 When Server state == {state}
 Reason for termination ==
 {{case_clause,already_registered},[{gproc,handle_reg_call,6,[{file,".../_build/default/lib/gproc/src/gproc.erl"},{line,2478}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,636}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,665}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}

Problem here: https://github.com/uwiger/gproc/blob/ce7397809aca0d6eb3aac6db65953752e47fb511/src/gproc.erl#L2492

Expected: gproc gen_server keep alive, return badarg

NoobsEnslaver commented 6 years ago

Pull request with fix https://github.com/uwiger/gproc/pull/162

abogosyan commented 6 years ago

To reproduce: just call gproc:reg({rc, l, test}). twice from erlang console, also affects aggregated counters and names (a,n) and maybe more