Skip to content

Commit

Permalink
Discard EXIT messages from trapped exits
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Mar 8, 2024
1 parent 8ef1f2e commit 286f849
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/db_connection/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ defmodule DBConnection.Connection do
end
end

# We discard EXIT messages which may arrive if the process is trapping exits
def handle_event(:info, {:EXIT, _, _}, :no_state, s) do
handle_timeout(s)
end

def handle_event(:info, msg, :no_state, %{mod: mod} = s) do
Logger.info(fn ->
[inspect(mod), ?\s, ?(, inspect(self()), ") missed message: " | inspect(msg)]
Expand Down

0 comments on commit 286f849

Please sign in to comment.