From d8b5feeb59dcb141263aeee5d14f42268d251d02 Mon Sep 17 00:00:00 2001 From: Parker Selbert Date: Thu, 18 Jul 2024 11:35:35 -0500 Subject: [PATCH] Log a warning for unhandled producer messages Some messages are falling through to the catch-all `handle_info/2` clause. Previously, they were silently ignored and it degraded producer functionality because inactive jobs with dead pids were still tracked as `running` in the producer. --- lib/oban/queue/producer.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/oban/queue/producer.ex b/lib/oban/queue/producer.ex index 7ed32d81..330c2df2 100644 --- a/lib/oban/queue/producer.ex +++ b/lib/oban/queue/producer.ex @@ -7,6 +7,8 @@ defmodule Oban.Queue.Producer do alias Oban.Queue.Executor alias __MODULE__, as: State + require Logger + defstruct [ :conf, :foreman, @@ -174,7 +176,9 @@ defmodule Oban.Queue.Producer do {:noreply, schedule_refresh(%{state | meta: meta})} end - def handle_info(_message, state) do + def handle_info(message, state) do + Logger.warning(message: inspect(message), source: :oban, module: __MODULE__) + {:noreply, state} end