Closed knopa closed 1 year ago
I think i had figure out first one
When you have own IClientFilter and you set inside job parameter in my case it's operation id from activity and for recurring jobs there is no activity - it failed on redis update for schedule jobs
so check if value not null before set helps filterContext.SetJobParameter
As for seconds still no clue how it happens, because it not 100% reproducible
Fixed with Hangfire.Pro.Redis 3.0.3.
I am using that version of hangfire packages while migration from sql to redis I got 2 issue .net core 7 Hangfire.Core 1.8.5 Hangfire.SqlServer 1.8.5 Hangfire.Pro 2.3.2 Hangfire.Pro.Redis 3.0.2 redis:latest
1. When Recurring job trying to run by schedule [16:05:09 WRN] Recurring job 'UserActivityJob' can't be scheduled due to an error and will be retried in 00:00:15.
2. Restart Server issue RecurringJob.AddOrUpdate(jobName, methodCall, jobSettings.Schedule, new RecurringJobOptions() { TimeZone = timezoneInfo ?? TimeZoneInfo.Utc }); When any recurring job was in execution - after restart server - it failes with next exception
Hangfire.Storage.DistributedLockTimeoutException: 'Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'lock:recurring-job:UserActivityJob' resource.'