Open vpatil007 opened 4 years ago
Try 0.3.1 version...
Execution RecurringJobScheduler is in the Failed state now due to an exception, execution will be retried no more than in 00:00:04 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:recurring-jobs:lock': The lock request timed out.' resource. at Hangfire.LiteDB.LiteDbDistributedLock.Acquire(TimeSpan timeout) at Hangfire.LiteDB.LiteDbDistributedLock..ctor(String resource, TimeSpan timeout, HangfireDbContext database, LiteDbStorageOptions storageOptions) at Hangfire.LiteDB.LiteDbConnection.AcquireDistributedLock(String resource, TimeSpan timeout) at Hangfire.Server.RecurringJobScheduler.UseConnectionDistributedLock[T](JobStorage storage, Func
2 action)
at Hangfire.Server.RecurringJobScheduler.EnqueueNextRecurringJobs(BackgroundProcessContext context)
at Hangfire.Server.RecurringJobScheduler.Execute(BackgroundProcessContext context)
at Hangfire.Server.BackgroundProcessDispatcherBuilder.ExecuteProcess(Guid executionId, Object state)
at Hangfire.Processing.BackgroundExecution.Run(Action2 callback, Object state)
i meet this exception too
I get this all the time, I was never able to solve (I'm on 0.4.0 with .NET 5) and switched to MemoryStorage
Yep, me too. Brand new app .Net8, still in development. Couldn't work out why the scheduled jobs wouldn't trigger. Then got the same exception as above.
Hangfire.Processing.BackgroundExecution: Error: Execution RecurringJobScheduler is in the Failed state now due to an exception, execution will be retried no more than in 00:00:04
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:recurring-jobs:lock': The lock request timed out.' resource.
at Hangfire.LiteDB.LiteDbDistributedLock.Acquire(TimeSpan timeout)
at Hangfire.LiteDB.LiteDbDistributedLock..ctor(String resource, TimeSpan timeout, HangfireDbContext database, LiteDbStorageOptions storageOptions)
at Hangfire.LiteDB.LiteDbConnection.AcquireDistributedLock(String resource, TimeSpan timeout)
at Hangfire.Server.RecurringJobScheduler.UseConnectionDistributedLock[T](JobStorage storage, Func`2 action) in C:\projects\hangfire-525\src\Hangfire.Core\Server\RecurringJobScheduler.cs:line 389
at Hangfire.Server.RecurringJobScheduler.EnqueueNextRecurringJobs(BackgroundProcessContext context) in C:\projects\hangfire-525\src\Hangfire.Core\Server\RecurringJobScheduler.cs:line 186
at Hangfire.Server.RecurringJobScheduler.Execute(BackgroundProcessContext context) in C:\projects\hangfire-525\src\Hangfire.Core\Server\RecurringJobScheduler.cs:line 159
at Hangfire.Server.BackgroundProcessDispatcherBuilder.ExecuteProcess(Guid executionId, Object state) in C:\projects\hangfire-525\src\Hangfire.Core\Server\BackgroundProcessDispatcherBuilder.cs:line 82
at Hangfire.Processing.BackgroundExecution.Run(Action`2 callback, Object state) in C:\projects\hangfire-525\src\Hangfire.Core\Processing\BackgroundExecution.cs:line 118
It would seem that LiteDB is just not fit for purpose here.
We are having problems with accessing the LiteDB database with Hangfire implementation. We are using Hangfire.LiteDB (0.3.0) and looks like for concurrent multi process environment database is getting locked, which results in crashing the Hangfire jobs. The size of the database is really small (3MB).
We are simply creating the connection and attaching it to the hangfireDB. Following is the connection code,
`public void ConfigureServices(IServiceCollection service) { ApiStartupExtensions.ConfigureServices(Configuration, service, _currentHostingEnvironment);
Could you share an example of how to implement concurrency with Hangfire jobs using HangFire.LiteDB or You can suggest a necessary changes required?