Jobs stuck in enqued state

Tags: #<Tag:0x00007f7b5c2a6938>

Hangfire v1.7.25
Hangfire.PostgreSql: v1.8.6
.NET 5.0

We are using Hangfire for Fire and forget jobs, most of the time our jobs are processed very quickly which means that jobs are only in enqued state for a short period of time.
But sometimes when a processing job fails or a job is running for a longer time, the jobs with status enqued will get stuck with status enqued even when the failing jobs finally have been processed and we have available workers. If we restart our hangfire service when this problem occurs all enqued jobs will be processed, but this is not a sustainable solution.

We can see in our logs that Hangfire throws: HangFire:locks:schedulepoller: Failed to lock with transaction

1 Like