Repository navigation
feat(node): Capture the original job error for failed BullMQ jobs - #26352
Merged
Merged
Conversation
Since bullmq 6.7.5, the worker passes the job error to recordException right before the job failed event (taskforcesh/bullmq#4915). Capture that error, so failed jobs keep their type and processor stack trace. Older versions still get the message-only error without a stack. Co-Authored-By: Jan Peer Stöcklmair <jan.peer@sentry.io>
Contributor
size-limit report 📦Compared: f1e99c6 (PR test merge using develop at 5808281) Against: ccb0acc (develop) · base run #65978
|
javascript-sdk-gitflow
Bot
requested review from
andreiborza,
isaacs and
nicohrubec
November 13, 2026 10:44
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 89c39db. Configure here.
s1gr1d
approved these changes
Nov 13, 2026
Contributor
Optional E2E testsSome optional checks were not successful. They do not block the merge. 4 not successful, 45 successful. See the run.
Successful checks
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why: Follow-up to #21777. Until now BullMQ only gave the telemetry adapter the error message, so we captured a synthetic
Errorwith no stack, and every failed job grouped by message alone. Since bullmq 6.7.5 the worker callsrecordException(err)with the job error right before thejob failedevent (taskforcesh/bullmq#4902, taskforcesh/bullmq#4915). We now keep that error and capture it, so failed jobs get their real type and processor stack trace. Older BullMQ versions fall back to the message-only error as before.Only
Errorinstances are kept: BullMQ passes the Redis/lock errors it retries as strings, and those reset the recorded error so they can't be captured as the job failure.How to review:
span.tsis the whole change. The integration test diff is mostly re-indentation: the failed-job scenario now runs against bullmq v5 (no stack) and^6.7.5(stack with frames from the scenario file).via Jan Peer Stöcklmair.
--
View Session [Sentry]