|
@@ -261,8 +261,8 @@ handle_call({unregister_on_owner, RequesterNode, Name, Pid}, _From, #state{
|
|
{reply, {{error, undefined}, undefined}, State}
|
|
{reply, {{error, undefined}, undefined}, State}
|
|
end;
|
|
end;
|
|
|
|
|
|
-handle_call(Request, From, State) ->
|
|
|
|
- error_logger:warning_msg("SYN[~s] Received from ~p an unknown call message: ~p", [node(), From, Request]),
|
|
|
|
|
|
+handle_call(Request, From, #state{scope = Scope} = State) ->
|
|
|
|
+ error_logger:warning_msg("SYN[~s|~s] Received from ~p an unknown call message: ~p", [?MODULE, Scope, From, Request]),
|
|
{reply, undefined, State}.
|
|
{reply, undefined, State}.
|
|
|
|
|
|
%% ----------------------------------------------------------------------------------------------------------
|
|
%% ----------------------------------------------------------------------------------------------------------
|
|
@@ -295,8 +295,8 @@ handle_info({'DOWN', _MRef, process, Pid, Reason}, #state{
|
|
case find_registry_entries_by_pid(Pid, TableByPid) of
|
|
case find_registry_entries_by_pid(Pid, TableByPid) of
|
|
[] ->
|
|
[] ->
|
|
error_logger:warning_msg(
|
|
error_logger:warning_msg(
|
|
- "SYN[~s] Received a DOWN message from an unknown process ~p with reason: ~p",
|
|
|
|
- [node(), Pid, Reason]
|
|
|
|
|
|
+ "SYN[~s|~s] Received a DOWN message from an unknown process ~p with reason: ~p",
|
|
|
|
+ [?MODULE, Scope, Pid, Reason]
|
|
);
|
|
);
|
|
|
|
|
|
Entries ->
|
|
Entries ->
|
|
@@ -312,8 +312,8 @@ handle_info({'DOWN', _MRef, process, Pid, Reason}, #state{
|
|
%% return
|
|
%% return
|
|
{noreply, State};
|
|
{noreply, State};
|
|
|
|
|
|
-handle_info(Info, State) ->
|
|
|
|
- error_logger:warning_msg("SYN[~s] Received an unknown info message: ~p", [node(), Info]),
|
|
|
|
|
|
+handle_info(Info, #state{scope = Scope} = State) ->
|
|
|
|
+ error_logger:warning_msg("SYN[~s|~s] Received an unknown info message: ~p", [?MODULE, Scope, Info]),
|
|
{noreply, State}.
|
|
{noreply, State}.
|
|
|
|
|
|
%% ----------------------------------------------------------------------------------------------------------
|
|
%% ----------------------------------------------------------------------------------------------------------
|
|
@@ -551,8 +551,8 @@ resolve_conflict(Scope, Name, {Pid, Meta, Time}, {TablePid, TableMeta, TableTime
|
|
case PidToKeep of
|
|
case PidToKeep of
|
|
Pid ->
|
|
Pid ->
|
|
%% -> we keep the remote pid
|
|
%% -> we keep the remote pid
|
|
- error_logger:info_msg("SYN[~s] Registry CONFLICT for name ~p@~s: ~p vs ~p -> keeping remote: ~p",
|
|
|
|
- [node(), Name, Scope, Pid, TablePid, Pid]
|
|
|
|
|
|
+ error_logger:info_msg("SYN[~s|~s] Registry CONFLICT for name ~p: ~p vs ~p -> keeping remote: ~p",
|
|
|
|
+ [?MODULE, Scope, Name, Pid, TablePid, Pid]
|
|
),
|
|
),
|
|
%% update locally, the incoming sync_register will update with the time coming from remote node
|
|
%% update locally, the incoming sync_register will update with the time coming from remote node
|
|
update_local_table(Name, TablePid, {Pid, Meta, Time, undefined}, TableByName, TableByPid),
|
|
update_local_table(Name, TablePid, {Pid, Meta, Time, undefined}, TableByName, TableByPid),
|
|
@@ -564,8 +564,8 @@ resolve_conflict(Scope, Name, {Pid, Meta, Time}, {TablePid, TableMeta, TableTime
|
|
|
|
|
|
TablePid ->
|
|
TablePid ->
|
|
%% -> we keep the local pid
|
|
%% -> we keep the local pid
|
|
- error_logger:info_msg("SYN[~s] Registry CONFLICT for name ~p@~s: ~p vs ~p -> keeping local: ~p",
|
|
|
|
- [node(), Name, Scope, Pid, TablePid, TablePid]
|
|
|
|
|
|
+ error_logger:info_msg("SYN[~s|~s] Registry CONFLICT for name ~p: ~p vs ~p -> keeping local: ~p",
|
|
|
|
+ [?MODULE, Scope, Name, Pid, TablePid, TablePid]
|
|
),
|
|
),
|
|
%% overwrite with updated time
|
|
%% overwrite with updated time
|
|
ResolveTime = erlang:system_time(),
|
|
ResolveTime = erlang:system_time(),
|
|
@@ -574,8 +574,8 @@ resolve_conflict(Scope, Name, {Pid, Meta, Time}, {TablePid, TableMeta, TableTime
|
|
syn_gen_scope:broadcast({'3.0', sync_register, Name, TablePid, TableMeta, ResolveTime}, State);
|
|
syn_gen_scope:broadcast({'3.0', sync_register, Name, TablePid, TableMeta, ResolveTime}, State);
|
|
|
|
|
|
Invalid ->
|
|
Invalid ->
|
|
- error_logger:info_msg("SYN[~s] Registry CONFLICT for name ~p@~s: ~p vs ~p -> none chosen (got: ~p)",
|
|
|
|
- [node(), Name, Scope, Pid, TablePid, Invalid]
|
|
|
|
|
|
+ error_logger:info_msg("SYN[~s|~s] Registry CONFLICT for name ~p: ~p vs ~p -> none chosen (got: ~p)",
|
|
|
|
+ [?MODULE, Scope, Name, Pid, TablePid, Invalid]
|
|
),
|
|
),
|
|
%% remove
|
|
%% remove
|
|
maybe_demonitor(TablePid, TableByPid),
|
|
maybe_demonitor(TablePid, TableByPid),
|