Hi, I'm using Hangfire with Mssql.
I keep having timeout issues on recurring jobs.
Hangfire.Storage.DistributedLockTimeoutException
Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'HangFire:HangfireBootstrapper.BackgroundTaskRunner.RunAll' resource.
Hangfire.Storage.DistributedLockTimeoutException: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'HangFire:HangfireBootstrapper.BackgroundTaskRunner.RunAll' resource.
at Hangfire.SqlServer.SqlServerDistributedLock.Acquire(IDbConnection connection, String resource, TimeSpan timeout)
at Hangfire.SqlServer.SqlServerConnection.AcquireLock(String resource, TimeSpan timeout)
at Hangfire.SqlServer.SqlServerConnection.AcquireDistributedLock(String resource, TimeSpan timeout)
at Hangfire.DisableConcurrentExecutionAttribute.OnPerforming(PerformingContext filterContext)
at Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func`1 continuation)
Any idea how to fix that?
Thanks
I am having the same issue. I have this attribute on my method:
[DisableConcurrentExecution(timeoutInSeconds: 10 * 60)]
In my case it is a recurring task that executes every hour.
Having the same problem over here. Is there some configuration missing? Am using RavenDB for storage.
Hangfire.Server.DelayedJobScheduler:Debug: An exception was thrown during acquiring distributed lock on the locks:schedulepoller resource within 60 seconds. The scheduled jobs have not been handled this time.
It will be retried in 15 seconds
Hangfire.Storage.DistributedLockTimeoutException: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'HangFire/locks:schedulepoller' resource.
at Hangfire.Raven.DistributedLocks.RavenDistributedLock.Acquire(TimeSpan timeout)
at Hangfire.Raven.DistributedLocks.RavenDistributedLock..ctor(RavenStorage storage, String resource, TimeSpan timeout, RavenStorageOptions options)
at Hangfire.Raven.RavenConnection.AcquireDistributedLock(String resource, TimeSpan timeout)
at Hangfire.Server.DelayedJobScheduler.UseConnectionDistributedLockT
Hangfire.Server.RecurringJobScheduler:Debug: An exception was thrown during acquiring distributed lock the recurring-jobs:lock resource within 60 seconds. The recurring jobs have not been handled this time.
Hangfire.Storage.DistributedLockTimeoutException: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'HangFire/recurring-jobs:lock' resource.
at Hangfire.Raven.DistributedLocks.RavenDistributedLock.Acquire(TimeSpan timeout)
at Hangfire.Raven.DistributedLocks.RavenDistributedLock..ctor(RavenStorage storage, String resource, TimeSpan timeout, RavenStorageOptions options)
at Hangfire.Raven.RavenConnection.AcquireDistributedLock(String resource, TimeSpan timeout)
at Hangfire.Server.RecurringJobScheduler.UseConnectionDistributedLock(JobStorage storage, Func`2 action)
Hi has anyone found a solution to this yet?
Happening for me too. I wish to find a solution to this. Again, it's only for long running jobs that run into each other.
Having the same issue w a Long running job
Set QueuePollInterval to 30 and it resolved the issue for me.
@kashyapus u mean QueuePollInterval = TimeSpan.FromSeconds(30) (30 seconds or other value u meant?
Thanks in advance for answer :)
@kashyapus u mean QueuePollInterval = TimeSpan.FromSeconds(30) (30 seconds or other value u meant?
Thanks in advance for answer :)
Yes you are correct. TimeSpan.FromSeconds(30)
What does QueuePollInterval when set to a higher value actually do? Does it decrease the amount of polls per timespan?
Most helpful comment
Hi has anyone found a solution to this yet?