Skip to content

Commit

Permalink
Log leaked trapped exits
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 3, 2023
1 parent f9bbe26 commit 5fae38e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/broadway/topology/batch_processor_stage.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ defmodule Broadway.Topology.BatchProcessorStage do
end

@impl true
def handle_info({:EXIT, pid, reason}, state) when reason not in [:normal, :shutdown] do
Logger.error(
"Batch processor received a trapped exit from #{inspect(pid)} with reason: " <>
Exception.format_exit(reason)
)

{:noreply, [], state}
end

def handle_info(_msg, state) do
{:noreply, [], state}
end
Expand Down
9 changes: 9 additions & 0 deletions lib/broadway/topology/processor_stage.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ defmodule Broadway.Topology.ProcessorStage do
end

@impl true
def handle_info({:EXIT, pid, reason}, state) when reason not in [:normal, :shutdown] do
Logger.error(
"Processor received a trapped exit from #{inspect(pid)} with reason: " <>
Exception.format_exit(reason)
)

{:noreply, [], state}
end

def handle_info(_msg, state) do
{:noreply, [], state}
end
Expand Down

0 comments on commit 5fae38e

Please sign in to comment.