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

[Bug]: Default timeout not documented? Is there one? #1930

Closed
1 task done
GeoffreyPlitt opened this issue May 31, 2023 · 5 comments
Closed
1 task done

[Bug]: Default timeout not documented? Is there one? #1930

GeoffreyPlitt opened this issue May 31, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@GeoffreyPlitt
Copy link

GeoffreyPlitt commented May 31, 2023

Version

v3.10.2

Platform

NodeJS

What happened?

Is there a default timeout? E.g., if I enqueue a task that hangs (runs forever, never succeeds or fails), without providing a timeout, is there a default timeout? I.e., will the task eventually be considered a "stall" and reset to a state where it will get picked up again by workers?

We see errors in our logs indicating tasks do stall and get reset back to workable state (Missing lock for job 4663). However I cannot find what the default timeout is.

I noticed there was never a resolution for #136.

And there's nothing in the docs about it.

How to reproduce.

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@GeoffreyPlitt GeoffreyPlitt added the bug Something isn't working label May 31, 2023
@roggervalf
Copy link
Collaborator

hi @GeoffreyPlitt, timeout was not used at all in the code, this is why it was removed, we don't have a mechanism for timeouts in the base version, we tried few things but we got zombie processes. So the only documented way is only available in pro version https://docs.bullmq.io/bullmq-pro/observables/cancelation because we are supporting observables there.

@GeoffreyPlitt
Copy link
Author

OK, so there's no timeout, good to know. For anyone else having this issue, you can add timeouts yourself with NPM module promise-timeout.

@manast
Copy link
Contributor

manast commented Jun 2, 2023

OK, so there's no timeout, good to know. For anyone else having this issue, you can add timeouts yourself with NPM module promise-timeout.

It is important to note that promises in Node are not cancelable, so when using promise-timeout you risk leaving asynchronous operations still running after the job has failed with the timeout. So this can be used, but you need to be aware of the consequences.

@GeoffreyPlitt
Copy link
Author

Right, those executions themselves cannot be stopped (without sandboxed workers, etc) but it's nice that the queueing system will make the job eligible to be started again. In an idempotent/at-least-once-delivery situation, you want the job to be retried. If you look at how SQS works, there is always a timeout.

@manast
Copy link
Contributor

manast commented Jun 2, 2023

I know SQS, but it is not really a timeout, it is a processing time window that can be extended actually (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html#changing-message-visibility-timeout). You can get the exact same behavior with BullMQ if you process your jobs manually instead of using the facilities provided by the Worker class: https://docs.bullmq.io/patterns/manually-fetching-jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants