Skip to content

[Bug]: Scheduler's reliance on "StartDate" to set "NextStart" guarantees time drift #7045

@r90727

Description

@r90727

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

"Messaging Dispatch" task runs every minute, and if you look at the history, each following start is shifted by a few seconds.

This happens because the logic is relying on "StartDate" from the previous run to set the "NextStart", and since the actual start time is triggered by a 10-second timer, it will be shifted by 1-9 seconds on each run.

This does not really matter for a task that runs every minute, but I want my custom tasks to run every hour at hh:00:00. With 5 second drift on each run, the task will drift by over a minute per day, I think the issue is obvious.

I'm working on PR that will rely on NextStart from previous run to set the NextStart of the future run. This way, there won't be any drift. Actual start time will still be a few second off, but that's not an issue.

Steps to reproduce?

  1. Install DNN, login as host
  2. Go to "Settings > Scheduler"
  3. Wait a few minutes to "Messaging Dispatch" task can run a few times
  4. Click on "Task History" icon, and note task start time drift (see screenshot)
Image

Current Behavior

Scheduler task StartDate drifts as it relies on StartDate to set NextStart

Expected Behavior

Scheduler task StartDate should NOT drift. Should rely on NextStart of current task to set NextStart for next task

Relevant log output

Anything else?

working on PR

Affected Versions

Current development branch (unreleased)

What browsers are you seeing the problem on?

Chrome

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions