Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix distributed monitor(Key, standby) when the name is not yet registered #111

Merged
merged 1 commit into from Dec 1, 2016

Conversation

ten0s
Copy link
Contributor

@ten0s ten0s commented May 7, 2016

Steps to reproduce the bug in original version:

INIT:

node1:
erl -sname n1 -pa ebin -pa deps/*/ebin

node2:
erl -sname n2 -pa ebin -pa deps/*/ebin

node1:
net_adm:ping('n2@carcharodon'), application:ensure_started(gproc), gproc_dist:start_link(all).

node2:
net_adm:ping('n1@carcharodon'), application:ensure_started(gproc), gproc_dist:start_link(all).

TEST:

node1:
gproc:monitor({n, g, test}, standby).

=ERROR REPORT==== 7-May-2016::21:09:29 ===
** Generic leader gproc_dist terminating
** Last message in was {'$leader_call',
{<0.45.0>,#Ref<0.0.2.214>},
{monitor,{n,g,test},<0.45.0>,standby}}
** When Server state == {state,false,true,[]}
** Reason for termination ==
** {function_clause,[{gproc_dist,insert_reg,
[[],
{n,g,test},
undefined,<0.45.0>,
{failover,<0.45.0>}],
[{file,"src/gproc_dist.erl"},{line,1027}]},
{gproc_dist,handle_leader_call,4,
[{file,"src/gproc_dist.erl"},{line,397}]},
{gen_leader,handle_msg,4,
[{file,"src/gen_leader.erl"},{line,1103}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,240}]}]}
** exception exit: function_clause
in function gproc_dist:insert_reg/5
called as gproc_dist:insert_reg([],{n,g,test},undefined,<0.45.0>,{failover,<0.45.0>})
in call from gproc_dist:handle_leader_call/4 (src/gproc_dist.erl, line 397)
in call from gen_leader:handle_msg/4 (src/gen_leader.erl, line 1103)
in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 240)

With fix applied:

INIT:
...
TEST:

node1:
gproc:monitor({n, g, test}, standby).

Ref<0.0.2.234>

flush().
Shell got {gproc,{failover,<0.45.0>},#Ref<0.0.2.234>,{n,g,test}}

node2:
gproc:where({n, g, test}).
<15262.45.0>

@uwiger uwiger merged commit 6d066d8 into uwiger:master Dec 1, 2016
@uwiger
Copy link
Owner

uwiger commented Dec 1, 2016

Sorry about the very long delay. Merged. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants