Skip to content

Commit

Permalink
Rescue and report staging errors with telemetry
Browse files Browse the repository at this point in the history
Staging errors from queue contention or other database issues would
cause the top level stager process to crash. Eventually that could shut
down the entire Oban supervision tree. Now we rescue standard database
connectivity issues instead and report them as errors in telemetry.
  • Loading branch information
sorentwo committed Jan 19, 2024
1 parent e0c4051 commit 4ca452a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/oban/stager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ defmodule Oban.Stager do

%{staged_count: length(staged), staged_jobs: staged}
end)
rescue
error in [DBConnection.ConnectionError, Postgrex.Error] -> {:error, error}
end

defp stage_scheduled(state, leader?: true) do
Expand Down

0 comments on commit 4ca452a

Please sign in to comment.