We have a process that is registered using:
def start_link do
case GenServer.start_link(__MODULE__, :ok, name: {:global, __MODULE__}) do
{:ok, pid} ->
Logger.info "---- #{__MODULE__} worker started"
{:ok, pid}
{:error, {:already_started, pid}} ->
Logger.info "---- #{__MODULE__} worker already running"
{:ok, pid}
end
end
Currently, if we kill the node running the singleton, the other node doesn’t seem to notice that the node is down, and the killed processes aren’t restarted.
E.g Supervisor.which_children on the remaining node returns the remote pid #PID<4554, 234, 0>, and :global.whereis_name returns :undefined
What we would like to see is that the supervisor restarts the process on the remaining node, but so far our attempts have been fruitless.