Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(worker): consider removed jobs in failed event #1500

Merged
merged 1 commit into from Nov 15, 2022

Conversation

roggervalf
Copy link
Collaborator

@roggervalf roggervalf commented Oct 27, 2022

@manast
Copy link
Contributor

manast commented Oct 27, 2022

I wonder, do we know the underlying reason for the job to be undefined in this particular case? is it possible to fix it so that it always is sent?

@roggervalf
Copy link
Collaborator Author

it is undefined because it was removed when it was moved to failed as it has removeOnFailed as true

@manast
Copy link
Contributor

manast commented Oct 27, 2022

Yes, that makes sense, that it is removed from Redis, but the worker itself should still keep a reference of the job instance, no?

@manast
Copy link
Contributor

manast commented Oct 27, 2022

I mean, for the global failed event, yes it must be undefined, but is it really the case for the local worker event?

@roggervalf
Copy link
Collaborator Author

hey, the escenario where this is happening is when we have stalled jobs that were removed https://github.com/taskforcesh/bullmq/blob/master/src/classes/worker.ts#L790-L797 in that case the only value that is available is the jobId that is returned by stalled script, but as we are creating an instance of a Job with the id of the removed job, we ended with an undefined value

@roggervalf roggervalf merged commit 8704b9a into master Nov 15, 2022
@roggervalf roggervalf deleted the failed-event-typing branch November 15, 2022 00:31
github-actions bot pushed a commit that referenced this pull request Nov 15, 2022
## [3.2.1](v3.2.0...v3.2.1) (2022-11-15)

### Bug Fixes

* **worker:** consider removed jobs in failed event ([#1500](#1500)) ([8704b9a](8704b9a))
@github-actions
Copy link

🎉 This PR is included in version 3.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants