From 271c9bfcabc24fb5790686680d24c68c11d43fb0 Mon Sep 17 00:00:00 2001 From: garrison Date: Tue, 24 Feb 2026 15:49:33 -0500 Subject: [PATCH] Fix supervisor trying to call itself --- lib/trinity/scheduler/simulation_supervisor.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/trinity/scheduler/simulation_supervisor.ex b/lib/trinity/scheduler/simulation_supervisor.ex index 0007252..95b6e65 100644 --- a/lib/trinity/scheduler/simulation_supervisor.ex +++ b/lib/trinity/scheduler/simulation_supervisor.ex @@ -36,7 +36,11 @@ defmodule Trinity.Scheduler.SimulationSupervisor do @spec spawn_child(GenServer.server, function) :: pid def spawn_child(server, fun) do - GenServer.call(server, {:spawn_child, fun}) + # This is a bit ridiculous + case server == self() do + true -> spawn_sim_child(%Simulation{} = Process.get(simulation_key()), fun) + false -> GenServer.call(server, {:spawn_child, fun}) + end end def kill_node(server, node) do -- 2.51.2