Skip to content

Commit

Permalink
Log a warning for unhandled producer messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sorentwo committed Jul 18, 2024
1 parent e63d60d commit d8b5fee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/oban/queue/producer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ defmodule Oban.Queue.Producer do
alias Oban.Queue.Executor
alias __MODULE__, as: State

require Logger

defstruct [
:conf,
:foreman,
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d8b5fee

Please sign in to comment.