Fix shutdown parameters for irc app supervisors.
authorMatt Mullins <mmullins@mmlx.us>
Sat, 4 May 2013 06:32:50 +0000 (23:32 -0700)
committerMatt Mullins <mmullins@mmlx.us>
Sun, 5 May 2013 07:36:00 +0000 (00:36 -0700)
Any supervisors it launches should wait infinitely, according to the
"supervisor" module docs.

Since irc_conn doesn't actually do anything on terminate/2, brutally kill it.
(It also doesn't trap exits, so it wouldn't get called /anyway/).

irc/irc_net_sup.erl
irc/irc_sup.erl

index bf81d24..1d60471 100644 (file)
@@ -27,7 +27,7 @@ init(Instance) ->
        Connection = {connection,
                   {irc_conn, start_link, [Instance, Supervisor, TableId]},
                   permanent, % persistence type ("Restart" in the manual)
-                  5,         % shutdown [sends signal, with timeout for response]
+                  brutal_kill, % shutdown [irc_conn doesn't actually cleanup]
                   worker,    % it's not a supervisor itself
                   [irc_conn] % modules it uses
                  },
@@ -41,7 +41,7 @@ create_object_sup(Instance, Supervisor, TableId) ->
     ObjectSup = {object_sup,
                  {irc_object_sup, start_link, [Instance, Supervisor, TableId]},
                  permanent,
-                 5,
+                 infinity,
                  supervisor,
                  [irc_object_sup]
                 },
index a4b4dd4..a920b2d 100644 (file)
@@ -22,7 +22,7 @@ config_to_childspec({Instance, _Config}) ->
     {Instance, % child's name
      {irc_net_sup, start_link, [Instance]}, % MFA
      permanent, % Restart
-     5, % shutdown [timeout of 5 seconds]
+     infinity, % shutdown [infinite timeout for supervisors, as per docs]
      supervisor,
      [irc_net_sup]
     }.