We have been using Hangfire for approximately 3 years+ with no significant problem but the latest release seems to have caused us a significant issue.
We have 2 servers running in an ASP.NET IIS process with approximately 113 recurring jobs.
On startup we setup recurring jobs which in previous releases and including this one setup all the recurring jobs, this all still works.
Occasionally though we find all the recurring jobs are being removed with no idea why this would occur. I have performed a SQL trace to find out when it happens and conclude it happens with no real schedule.
Last evening it removed them all at 23:54, 00:02 and then 06:47!
The trace shows the SQL being executed as the following, one for each recurring job:
exec sp_executesql N’delete from [HangFire].Hash where [Key] = @key’,N’@key nvarchar(100)’,@key=N’recurring-job:jobid’
All other scheduled jobs remain intact and Hangfire continues to run.
We have code that will schedule and unschedule new recurring jobs using the API but these are only single jobs and we never actively remove all recurring jobs via the API so are a little stumped.
Has anybody experienced this behaviour?
I am going to do more investigation to find out the root cause and will update this once I have more information.