Browse Source

Ignore the shutdown exit reasons

These can happen normally and are frequent whenever supervision
trees are involved and processes are asked to stop by the
supervisor.
Loïc Hoguin 7 years ago
parent
commit
8523512287
2 changed files with 8 additions and 0 deletions
  1. 4 0
      src/syn_groups.erl
  2. 4 0
      src/syn_registry.erl

+ 4 - 0
src/syn_groups.erl

@@ -246,6 +246,8 @@ handle_info({'EXIT', Pid, Reason}, #state{
             %% log
             %% log
             case Reason of
             case Reason of
                 normal -> ok;
                 normal -> ok;
+                shutdown -> ok;
+                {shutdown, _} -> ok;
                 killed -> ok;
                 killed -> ok;
                 _ ->
                 _ ->
                     error_logger:error_msg("Received an exit message from an unlinked process ~p with reason: ~p", [Pid, Reason])
                     error_logger:error_msg("Received an exit message from an unlinked process ~p with reason: ~p", [Pid, Reason])
@@ -259,6 +261,8 @@ handle_info({'EXIT', Pid, Reason}, #state{
                 %% log
                 %% log
                 case Reason of
                 case Reason of
                     normal -> ok;
                     normal -> ok;
+                    shutdown -> ok;
+                    {shutdown, _} -> ok;
                     killed -> ok;
                     killed -> ok;
                     _ ->
                     _ ->
                         error_logger:error_msg("Process of group ~p and pid ~p exited with reason: ~p", [Name, Pid, Reason])
                         error_logger:error_msg("Process of group ~p and pid ~p exited with reason: ~p", [Name, Pid, Reason])

+ 4 - 0
src/syn_registry.erl

@@ -237,6 +237,8 @@ handle_info({'EXIT', Pid, Reason}, #state{
             %% log
             %% log
             case Reason of
             case Reason of
                 normal -> ok;
                 normal -> ok;
+                shutdown -> ok;
+                {shutdown, _} -> ok;
                 killed -> ok;
                 killed -> ok;
                 _ ->
                 _ ->
                     error_logger:error_msg("Received an exit message from an unlinked process ~p with reason: ~p", [Pid, Reason])
                     error_logger:error_msg("Received an exit message from an unlinked process ~p with reason: ~p", [Pid, Reason])
@@ -254,6 +256,8 @@ handle_info({'EXIT', Pid, Reason}, #state{
             case Reason of
             case Reason of
                 normal -> ok;
                 normal -> ok;
                 shutdown -> ok;
                 shutdown -> ok;
+                shutdown -> ok;
+                {shutdown, _} -> ok;
                 killed -> ok;
                 killed -> ok;
                 _ ->
                 _ ->
                     error_logger:error_msg("Process with key ~p and pid ~p exited with reason: ~p", [Key0, Pid, Reason])
                     error_logger:error_msg("Process with key ~p and pid ~p exited with reason: ~p", [Key0, Pid, Reason])