Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail an enqueued job if its dependencies already failed.
This was a bug that was most notable during the attachment pre-upload process: if an attachment failed to upload, the subsequently-enqueued PushMediaSendJob would still send. This is because the attachment jobs were enqueued first and failed *before* we enqueued the PushMediaSendJob as a dependency. This will use the JobTracker to determine if a dependency already failed at the time of enqueueing a job like this. This isn't perfect, because the JobTracker is memory-only and has a limited buffer (currently 1000), but in practice this should be sufficient for our use cases. I imagine it'd only fall apart if we somehow enqueued a dependent job *much* later, or somehow enqueued it based on a job ID that we persisted on disk through an app restart. We don't do any of these things, currently, and probably never should. Also took the opportunity to patch a case where we weren't failing dependent jobs when canceling a job, since I was giving the failure stuff a look-over.
- Loading branch information
1 parent
b935999
commit 158f3d8
Showing
2 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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