You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be possible to define a TTL (time to live) for jobs being processed by a worker.
If this TTL is reached and the job has not yet being completed we should notify the worker that the job has exceeded its time to live and that it will be "discarded" so that the processor code has an opportunity to close itself gracefully.
Details
A new TTL option should be introduced in the Job's options, so that we can have different TTLs for every job in a given queue if needed.
A new optional callback function can be provided in the processor function, this callback will be called before expiring the job. This function should be async so that the TTL can wait for asynchronous graceful shutdown (however we also need a TTL for this graceful shutdown).
The expiring mechanism will imply that the worker removes the lock token for the given job and fails it with reason "TTL Expired". For a standard worker it could happen that the processor does not close gracefully and so this processor may actually complete in the future and try to move the job to the completed state, however this will not be possible since the lock has been removed so the operation will fail and ignored.
For sandboxed processes we can actually kill the process entirely, which will work as long as we keep the concurrency of processors per process to 1. Killing the process will clean all the resources associated to the malfunctioning processor which I think is what most users would expect.
The text was updated successfully, but these errors were encountered:
Summary
It should be possible to define a TTL (time to live) for jobs being processed by a worker.
If this TTL is reached and the job has not yet being completed we should notify the worker that the job has exceeded its time to live and that it will be "discarded" so that the processor code has an opportunity to close itself gracefully.
Details
A new TTL option should be introduced in the Job's options, so that we can have different TTLs for every job in a given queue if needed.
A new optional callback function can be provided in the processor function, this callback will be called before expiring the job. This function should be async so that the TTL can wait for asynchronous graceful shutdown (however we also need a TTL for this graceful shutdown).
The expiring mechanism will imply that the worker removes the lock token for the given job and fails it with reason "TTL Expired". For a standard worker it could happen that the processor does not close gracefully and so this processor may actually complete in the future and try to move the job to the completed state, however this will not be possible since the lock has been removed so the operation will fail and ignored.
For sandboxed processes we can actually kill the process entirely, which will work as long as we keep the concurrency of processors per process to 1. Killing the process will clean all the resources associated to the malfunctioning processor which I think is what most users would expect.
The text was updated successfully, but these errors were encountered: