I’m trying to figure out where ** (EXIT from #PID<0.156223.0>) {:badmatch, ""}
is coming from in some discarded Oban jobs. I surrounded my job’s perform()
function with a try, rescue, catch
block which reraises everything with a more descriptive error, but this doesn’t occur.
Any tips on figuring out where this is occurring? I know I’m looking at the right module. If I retry my discarded job, it succeeds.
Here’s my Worker configuration.
use Oban.Worker,
queue: :my_queue,
max_attempts: 1,
unique: [
# Ensure only one job is running for a given set of out_dirs
keys: [:out_dirs, :project_id],
# Only consider the :available and :scheduled states
# If a job is already running, allow a new job to be scheduled.
# If a job is waiting to run, don't allow a new job to be scheduled.
states: [:available, :scheduled]
]
and my perform function
@impl Oban.Worker
def perform(%Oban.Job{args: args}) do
try do
...
rescue
error ->
raise {error, "Error in job"}
catch
other ->
raise {other, "Unexpected error in job"}
end
end
Even with all of that, I still see the following in Oban Web.
EDIT: I added a retry: 3, which caused one such job to fail 3 times in a row, which was surprising because manually retrying the job ended in a success state.