HangfireIO / HangfireIO/Hangfire

Recurring job execution time is inaccurate

Open
#2,341 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

![image](https://github.com/HangfireIO/Hangfire/assets/16652353/b24b0df4-bc41-4921-82c9-50bda956fc11)

My config:

var options = new SqlServerStorageOptions
{
SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
QueuePollInterval = TimeSpan.Zero
};

builder.Services.AddHangfire(configuration => configuration.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseSimpleAssemblyNameTypeSerializer().UseRecommendedSerializerSettings()
.UseSqlServerStorage(schedulerSetting.ConnectionString, options)
.UseFilter(new AutomaticRetryAttribute { Attempts = 0 })
.UseFilter(new DisableConcurrentExecutionAttribute (schedulerSetting.ConcurrentExecutionTimeoutSeconds))
.UseSerilogLogProvider()
);

Cron: "59 * * * * *"

hangfire version:
![image](https://github.com/HangfireIO/Hangfire/assets/16652353/dc5912a8-85d8-497c-8956-564d69259f94)

The program's local time is 4 seconds faster than the database; Each execution of the schedule is slower than the last time;Please help please.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied configuration and six-field Cron schedule while comparing application and database clocks. Determine why successive recurring executions drift in timing, and consider the issue done when executions occur at the intended schedule despite the reported four-second clock difference.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, sql
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.