Closed jessemcdowell-AI closed 3 years ago
When I originally reported this, I excluded that I'd sent the InvisibilityTimeout
property on PostgreSqlStorageOptions
, and it now seems that has something to do with the locks not getting cleaned up. Of course I realized that after creating the issue...
After a bit more testing, I don't think I actually capture the problem I'm experiencing. I'll close this for now and create a new issue if I can isolate it better.
I've been testing the changes in https://github.com/ahydrax/Hangfire.PostgreSql/pull/24, but have found a problem. When a lock is acquired and the application dies without running it's cleanup routine, it appears that nothing is cleaning up the lock.
Steps to reproduce:
InvisibilityTimeout = TimeSpan.FromMinutes(2)
DistributedLockTimeout = TimeSpan.FromMinutes(20)
- needs to be longer than the job runs or it gets cancelledHeartbeatInterval = TimeSpan.FromSeconds(30)
ServerCheckInterval = TimeSpan.FromMinutes(1)
ServerTimeout = TimeSpan.FromMinutes(2)
DisableConcurrentExecutionAttribute
BackgroundJobServer.Dispose()
to executeIn this case, the lock will remain in place for 20 minutes (value of DistributedLockTimeout), instead of 2 minutes (
ServerTimeout
) as I would expect.