-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I ran into this issue when I had a gen_server module that called iserve:add_server/4 during init. If the module died, it was restarted by the supervisor, then during the call to iserve_master:call_add_server/2, iserve_server_sup:add_server/2 would return {error, {already_started, Pid}} rather than {ok, Pid}, which caused a badmatch in the iserve_master process, killing it.
The following patch fixes the issue:
---
src/iserve_master.erl | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/iserve_master.erl b/src/iserve_master.erl
index 02872fc..879c6e9 100644
--- a/src/iserve_master.erl
+++ b/src/iserve_master.erl
@@ -51,9 +51,8 @@ code_change(_OldVsn, State, _Extra) ->
%%% Internal functions
call_add_server({_Starter, _Port, _Callback, _Context}=Conf, S) ->
- {ok, Pid} = iserve_server_sup:add_server(S#state.supervisor, Conf),
+ Reply = iserve_server_sup:add_server(S#state.supervisor, Conf),
%% TODO: Monitor the little bugger
- Reply = {ok, Pid},
{reply, Reply, S}.
call_del_server(Pid, S) ->
--
1.6.3.3
Metadata
Metadata
Assignees
Labels
No labels