Closed ghost closed 3 years ago
Yes, the retention period is how long a job may exist in a queue if it were never picked up. They are not considered expired, which applies to active jobs that weren't completed, but rather abandoned/archived. They will stay in the archive table for another interval before being permanently deleted.
Completed jobs are moved to the same archive after 12 hours, but can be customized as well via archiveCompletedAfterSeconds
.
@timgit what is the purpose to archive a job? Would it be possible to delete the job as soon as we are done with it?
Thanks for the quick response!
A few more things I'm still not clear about:
failed
jobs, I'm guessing they behave like completed
jobs with respect to cleanup?retry
status, do jobs go from active
directly to retry
if they fail and have a retryLimit
set? Do jobs that are in retry
behave like created
jobs for every other purpose?The purpose of the archive table is to manage the size of the primary job table without forcing jobs to be permanently deleted. You can control how long a job remains in the archive via configuration settings.
What about failed jobs, I'm guessing they behave like completed jobs with respect to cleanup?
Failed, cancelled and completed jobs are all considered "completed" and treated the same in regards to archival.
What about the retry status, do jobs go from active directly to retry if they fail and have a retryLimit set? Do jobs that are in retry behave like created jobs for every other purpose?
Yes, this is how it works.
I drafted a quick state diagram of all the possible states a job goes through - if you want (and it's in fact correct), I can create a PR putting it somewhere in docs?
Looks great! Thanks. You could add this image in a new images subfolder in /docs in the PR for relative path refs
This diagram is super useful. However on reading #208 I thought that expired
jobs can be retried if the retryLimit
option is set. This isn't shown in the diagram, though?
They are retried via the retry state
The docs for "Retention options" state that the options control
I'm a little confused as to what that means specifically. Jobs start out as
created
, right? Will they expire if not picked up before the configured retention time? What about alreadycompleted
jobs?In general, a state diagram on how a job can change from state to state would be great - is there any docs about this?