Sequence of jobs seems to stop after an error

So we’re using Hangfire to run jobs sequentially. We want them to run regardless if the previous job succeeded or errored.

The call is made like so:

previousId = BackgroundJob.ContinueWith<BackgroundRunner>(previousId, x => x.Run(args), JobContinuationOptions.OnAnyFinishedState);

It seems to work most of the time, but if there’s an error, subsequent tasks get stuck like so:

In this case, #2501597 is:

Anything I’m doing wrong here? Maybe it has to do with the MongoDB storage for Hangfire?

Oh, also automatic retries are turned off for the jobs. Errors aren’t transient so there’s no reason to retry them.

Any updates on this? We also use Mongo and seem to have more or less the same problem, the difference only being that the parent state is Succeeded. But the effect is the same: a perfectly runnable task will await forever. When we reconfigure hangfire to use SQL Server, there is no such behavior.

1 Like