DistributedLockTimeoutException with Hangfire.Storage.SQLite
See original GitHub issueI’m sorry I don’t know how to reliably reproduce this exception. All I can tell you is that MyJobClass.MyJobMethod
has this attribute: [DisableConcurrentExecution(timeoutInSeconds: 10 * 60)]
and that I’m using a TransactionScope to create two dependent jobs.
Hangfire.AutomaticRetryAttribute|Failed to process the job '123': an exception occurred. Retry attempt 1 of 10 will be performed in 00:00:39.
Hangfire.Storage.DistributedLockTimeoutException: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'Could not place a lock on the resource 'HangFire:MyJobClass.MyJobMethod': The lock request timed out.' resource.
at void Hangfire.Storage.SQLite.SQLiteDistributedLock.Acquire(TimeSpan timeout)
at new Hangfire.Storage.SQLite.SQLiteDistributedLock(string resource, TimeSpan timeout, HangfireDbContext database, SQLiteStorageOptions storageOptions)
at IDisposable Hangfire.Storage.SQLite.HangfireSQLiteConnection.AcquireDistributedLock(string resource, TimeSpan timeout)
at void Hangfire.DisableConcurrentExecutionAttribute.OnPerforming(PerformingContext filterContext)
at bool Hangfire.Profiling.ProfilerExtensions.InvokeAction<TInstance>(InstanceAction<TInstance> tuple)
at TResult Hangfire.Profiling.SlowLogProfiler.InvokeMeasured<TInstance, TResult>(TInstance instance, Func<TInstance, TResult> action, string message)
at void Hangfire.Profiling.ProfilerExtensions.InvokeMeasured<TInstance>(IProfiler profiler, TInstance instance, Action<TInstance> action, string message)
at PerformedContext Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func<PerformedContext> continuation)
Anyway I switched to HangFire.SqlServer and this problem did not occur anymore.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Releases · raisedapp/Hangfire.Storage.SQLite
An Alternative SQLite Storage for Hangfire. Contribute to raisedapp/Hangfire.Storage.SQLite development by creating an account on GitHub.
Read more >Hangfire with Sqlite Storage executing multiple instances ...
I am using SQLite as storage for Hangfire with default worker count of 20. I have a recurring job scheduled to run every...
Read more >Topics tagged recurring
Distributed Lock Timeout Exception - Timeout expired ... Hangfire with Sqlite Storage executing multiple instances of recurring jobs.
Read more >Hangfire causing locks in SQL Server
It seems like Hangfire is locking our DB rendering whole DB unusable. ... well as all jobs failing with "DistributedLockTimeoutException", ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same here 😦
Happens to us too. once every couple of days this occurs in production … awful