Erlang Takeover After Successful Fault Tolerance

I have an application distributed across two nodes. When I stop () the first node the failover works fine, but (sometimes?) When I restart the first node the crash crashes and the app crashes as start_link comes back already running.

SUPERVISOR REPORT  <0.60.0>                                 2009-05-20 12:12:01
===============================================================================
Reporting supervisor                          {local,twitter_server_supervisor}

Child process
   errorContext                                                     start_error
   reason                                         {already_started,<2415.62.0>}
   pid                                                                undefined
   name                                                                    tag1
   start_function                                {twitter_server,start_link,[]}
   restart_type                                                       permanent
   shutdown                                                               10000
   child_type                                                            worker

ok

      

My app

start(_Type, Args)->
    twitter_server_supervisor:start_link( Args ).

stop( _State )->
    ok.

      

My director:

start_link( Args ) ->
    supervisor:start_link( {local,?MODULE}, ?MODULE, Args ).    

      

Both nodes use the same sys.config file.

What I don't understand about this process that the above shouldn't work?

+1


a source to share


1 answer


Your problem seems to be related to the Twitter server supervisor trying to start one of his children. Since the bug reports a child with start_function

{twitter_server,start_link,[]}

      

And since you are not showing this code, I can only assume that it is trying to register a name for itself, but a process with that name is already registered.



Even more guesswork, the reason shows Pid, ​​Pid, ​​which has a name that we tried to grab for ourselves:

{already_started,<2415.62.0>}

      

Pid has a non-zero seed, if it is zero, it means it is a local process. From which I conclude that you are trying to register a global name and you are connected to another node where there is already a global process registered with that name.

+2


a source







All Articles