HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.44k stars 1.71k forks source link

RecurringJob Keep Processing State #1628

Open yurzhello opened 4 years ago

yurzhello commented 4 years ago

RecurringJob.AddOrUpdate to Create Job。 Sometimes it happens that the job is always in processing state, but it seems that the job has been released. I've added a lot of logs to this code, but even if it's half recorded, it's gone, and there's no exception. If I trigger this job again, it runs normally.

xklonx commented 4 years ago

+1 it happened once in my console application, none of the other tasks started, and every half an hour another worker was connected to this job. I did not find anything in the method that could take so long and when I started the debug, none of the breakpoints worked. I use DisableConcurrentExecutionAttribute, looks like for some reason distributed lock is stucked and when i restarted application it was released. I think its easier to reproduce when multiple recurring jobs running every minute. Happend again and i dont know why jobs not planned even when only two of them stucked image Looks like its caused by HangFire:recurring-jobs:lock that is not released for some reason, perhaps the reason is PostgreSqlStorageOptions.DistributedLockTimeout 24 hours that i use instead of default 10 minutes, which lead to several parallel tasks execution after 10 minutes. The reason is this error, dont know what to do with it Recurring job '***' can not be scheduled due to an exception. System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.TimeoutException: Transaction Timeout

Example here https://github.com/frankhommers/Hangfire.PostgreSql/issues/119#issuecomment-605337122

hakancunier commented 2 years ago

Same issue here...