I accidentally called GenServer.reply(from, :ok) twice so I got the following error message in my logs. For me the message is rather cryptic. What in the message could point me to the fact that i called reply twice?
if you see {#Referenceā¦, } that is the signature of a gen_server call reply. the module: ⦠is the module of the genserver that received the stray reply. Unfortunately, the source gen_server cannot be easily known, so I would say the best you can do is look at and try to figure out what could have emitted that. In the case of :ok, you might have to look in a lot of places, ha.
you do NOT want to replace the logger for stray messages. i have pushed code to prod that I was able to debug because these errors showed up in my monitoring months later (it wasnāt diminishing the user experience in a knowable way, but it was nice to be able to sleep sounder at night)
defmodule SCs do
# ... SCs code
def handle_info(msg, state) do
msg |> IO.inspect(label: "message")
state |> IO.inspect(label: "state")
{:noreply, state}
end
end
It seems like bug in the GenServer error message handling, or in Elixir error handler. I will need to dig it more to check what os the source of the problem.