[erlang-questions] Issue while starting same worker(gen_server) multiple times in Supervisor

harsha sri harsha.pic@REDACTED
Thu Mar 26 15:49:16 CET 2015


Hi,

I am trying to start same worker multiple times in Supervisor but its
giving me error.
Here is my Supervisor:


-module(uclient_sup).

-behaviour(supervisor).

-export([start_link/0, init/1]).

-define(
   CHILD(Name, Args),
   {Name, {
       uclient_worker, start_link, [{<<"callmgr">> , 3}]
       }, permanent, 5000, worker, []
   }
).

start_link() ->
    supervisor:start_link({global, ?MODULE}, ?MODULE, _Arg = []).

init([]) ->
   Children = [?CHILD("uc1", Address), ?CHILD("uc2", Address)],
   {ok, { {one_for_one, 6, 10}, Children }}.

I am getting below error:

Error: {could_not_start,uclient,
           {{shutdown,

{failed_to_start_child,"uc2",{already_started,<5169.429.0>}}},
            {uclient,start,[normal,[]]}}}


Please help me in solving this issue. I am new to erlang.

Thanks & Regards,
SriHarsha.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150326/0282f7cc/attachment.htm>


More information about the erlang-questions mailing list