Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SystemTime changing issues #1508

Open
GieltjE opened this issue Feb 4, 2022 · 2 comments
Open

SystemTime changing issues #1508

GieltjE opened this issue Feb 4, 2022 · 2 comments

Comments

@GieltjE
Copy link

GieltjE commented Feb 4, 2022

When the system time changes (at least on windows) in certain scenarios no more triggers are fired.
See pull request #1490, not expecting it to make it to the normal repository as it depends on windows specific dll imports.
This pull request doesn't work when they are replaced with the SystemTime object making that incomplete too.

Version: 3.3.3
Reproduction: #1490
Expected behaviour: Somewhat predictable continuation of trigger execution.

@EbenZhang
Copy link

EbenZhang commented Mar 3, 2022

I remember this happened in 2.x too, but I was able to workaround it by setting the misfire instruction to fire now.
But with 3.x, the misfire trick doesn't work any more.

The steps I did were:

  • Have a simple trigger that will fire soon for example 1 minute, let's say 5pm 02/Feb/2022
  • Change system time to yesterday 5pm 01/Feb/2022
  • Wait for 1 minute so the actual time is 5:01pm or so.
  • Change the system time back to 02/Feb/2022
  • Notice the job will never fired again.

Did an investigation, it seems the thread is waiting for the sigLock for a long time if the SystemTime.UtcNow() is behind a lot.

now = SystemTime.UtcNow();
timeUntilTrigger = triggerTime - now;
if (timeUntilTrigger > TimeSpan.Zero)
{
    Monitor.Wait(sigLock, timeUntilTrigger);
}

hmm, seems a workaround is to have a watchdog to monitor such scenario and pause/resume all triggers to signal the sigLock.

@GieltjE
Copy link
Author

GieltjE commented Mar 6, 2022

Thanks for the more in depth information, let's hope we can get it fixed with that and the test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants