Skip to content

Conversation

jeffkreeftmeijer
Copy link
Member

Previously, Oban timeouts weren't caught as they happen outside of any jobs. This means that there's no active span when the exception happens, resulting in the error being dropped. This patch creates a span if none exists when an exception happens, giving a send_error-like functionality to catch these errors too.

Closes #1012.

For situations where an error is raised from the main Oban process
instead of the spawned process, create an ad-hoc span instead of using
an already existing one.

This produces an effect like our send_error helper, which doesn't have
context but makes sure the error is still reported.
Because ad-hoc exception spans in Oban don't have their context set
when the span is created, set all context when handing the error.
This test ensures oban_job_exception/4 creates a span when none
exists, including the metadata that would have been added to the span
if it existed before the exception was raised.
@jeffkreeftmeijer jeffkreeftmeijer self-assigned this Oct 7, 2025
@jeffkreeftmeijer jeffkreeftmeijer added the feature A new feature for this component. label Oct 7, 2025
@backlog-helper
Copy link

backlog-helper bot commented Oct 7, 2025

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

Because spans are now created from both oban_job_start/4 and
oban_job_exeption/4, this patch adds do_oban_job_start/1, which is
called from both functions.
"Add support for Oban timeout exceptions"
@jeffkreeftmeijer jeffkreeftmeijer merged commit 58ffb33 into main Oct 9, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new feature for this component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oban.TimeoutError are not reported to AppSignal

3 participants