Browse Source

Do not check if pid is on connected node.

It should be anyways, since the EXIT messages only get to the node the process was linked on anyways.
Roberto Ostinelli 9 years ago
parent
commit
75369631f0
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/syn_backbone.erl

+ 8 - 2
src/syn_backbone.erl

@@ -228,7 +228,7 @@ handle_info({'EXIT', Pid, Reason}, #state{
     %% do not lock backbone
     %% do not lock backbone
     spawn(fun() ->
     spawn(fun() ->
         %% check if pid is in table
         %% check if pid is in table
-        case find_by_pid(Pid, with_meta) of
+        case i_find_by_pid(Pid) of
             undefined ->
             undefined ->
                 case Reason of
                 case Reason of
                     normal -> ok;
                     normal -> ok;
@@ -236,9 +236,14 @@ handle_info({'EXIT', Pid, Reason}, #state{
                     _ ->
                     _ ->
                         error_logger:warning_msg("Received an exit message from an unlinked process ~p with reason: ~p", [Pid, Reason])
                         error_logger:warning_msg("Received an exit message from an unlinked process ~p with reason: ~p", [Pid, Reason])
                 end;
                 end;
-            {Key, Meta} ->
+            Process ->
+                %% get process info
+                Key = Process#syn_processes_table.key,
+                Meta = Process#syn_processes_table.meta,
+
                 %% delete from table
                 %% delete from table
                 remove_process_by_key(Key),
                 remove_process_by_key(Key),
+
                 %% log
                 %% log
                 case Reason of
                 case Reason of
                     normal -> ok;
                     normal -> ok;
@@ -246,6 +251,7 @@ handle_info({'EXIT', Pid, Reason}, #state{
                     _ ->
                     _ ->
                         error_logger:error_msg("Process with key ~p exited with reason: ~p", [Key, Reason])
                         error_logger:error_msg("Process with key ~p exited with reason: ~p", [Key, Reason])
                 end,
                 end,
+
                 %% callback
                 %% callback
                 case ProcessExitCallbackModule of
                 case ProcessExitCallbackModule of
                     undefined -> ok;
                     undefined -> ok;