]> granicus.if.org Git - ejabberd/commitdiff
Avoid lager crash on external authentication failure
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 8 Jun 2018 06:51:26 +0000 (09:51 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Fri, 8 Jun 2018 06:51:26 +0000 (09:51 +0300)
Fixes #2463

src/extauth.erl
src/extauth_sup.erl

index b9d4724083030ccb07e1e2e36b499c9bf72b4a52..170dc23a088fb9112a44f0c20f0a1df9b856394f 100644 (file)
@@ -128,7 +128,7 @@ handle_call({cmd, Cmd, EndTime}, _From, State) ->
                {'EXIT', Port, Reason} ->
                    handle_info({'EXIT', Port, Reason}, State)
            after Timeout ->
-                   {stop, extauth_program_timeout, State}
+                   {stop, normal, State}
            end;
        true ->
            {noreply, State}
@@ -148,7 +148,7 @@ handle_info({'EXIT', Port, _Reason}, #state{port = Port,
            ?ERROR_MSG("External authentication program '~s' has terminated "
                       "unexpectedly (pid=~w), restarting via supervisor...",
                       [State#state.prog, State#state.os_pid]),
-           {stop, extauth_program_failure, State}
+           {stop, normal, State}
     end;
 handle_info(Info, State) ->
     ?WARNING_MSG("Unexpected info: ~p", [Info]),
index 882c47df5a4cfb97437d80288080552f0db67d0c..c9dc0cdff9241cb0227418aab4a4127b3f83b4e1 100644 (file)
@@ -107,4 +107,4 @@ init([Host, Prog, Pool]) ->
 worker_spec(Pool, Prog, I) ->
     Worker = extauth:worker_name(Pool, I),
     {Worker, {extauth, start_link, [Worker, Prog]},
-     transient, 5000, worker, [extauth]}.
+     permanent, 5000, worker, [extauth]}.