Closed beardedeagle closed 6 years ago
Any updates?
Turns out, for me, this was an issue with my startup module which is meant to catch any orphaned processes on startup (fixed code below, effectively instead of blindly sending to my initialize module where I was issuing a Process.exit(PID, :restart), I'm not ensuring it isn't already running in swarm):
defmodule Vanguard.Check.Startup do
@moduledoc """
`Vanguard.Check.Startup` is a task that starts checks which may not be running on startup.
"""
use Task
alias Vanguard.Db.CheckStore
def start_link(_args) do
Task.start_link(__MODULE__, :run, [])
end
def run do
:mnesia.wait_for_tables([CheckStore], 15_000)
{:ok, records} = CheckStore.read_check()
Enum.each(records, fn record ->
case Swarm.whereis_name(Map.get(record, :check_id)) do
:undefined ->
GenServer.call(
Vanguard.Check.Initialize,
{:initialize, Map.get(record, :check_id), Map.get(record, :check_state)}
)
_ ->
:ok
end
end)
end
end
Don't know if this gives you any hints @ourway
@beardedeagle Is this resolved or do you believe there is still an issue here?
The issue is solved. I left open to potentially help others. Closing.
This issue greatly resembles #89 but isn't quite the same in how it presents.
Timeline:
Logs:
test01:
test02:
If need be I can push my code somewhere for testing.