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

The leap second caused a scheduled job to run twice #30

Open
bdesham opened this issue Jan 9, 2017 · 4 comments
Open

The leap second caused a scheduled job to run twice #30

bdesham opened this issue Jan 9, 2017 · 4 comments

Comments

@bdesham
Copy link

bdesham commented Jan 9, 2017

I have a job that is scheduled to run at 0 0 1 * *, i.e. at midnight at the beginning of each month. This worked as expected until this past January 1, when the job ran twice. PostgreSQL reports that the task ran at the following times:

  • 2016-12-31 23:59:59.070603+00
  • 2017-01-01 00:00:00.006794+00

For comparison, the most recent normal run happened at 2016-12-01 00:00:00.006968+00.

I assume that the culprit was the leap second that was inserted at the end of 2016-12-31: there was a 23:59:60 on that day.

This happened under Ubuntu 14.04.5. The machine uses NTP (with, I believe, whatever the default Ubuntu configuration is) to keep its time in sync.

@sorki
Copy link

sorki commented Jul 12, 2018

At least for chrony this behavior is actually configurable - see https://chrony.tuxfamily.org/doc/2.4/chrony.conf.html#leapsecmode

@bdesham
Copy link
Author

bdesham commented Jul 12, 2018

Is chrony related to this cron library somehow, or are you just pointing out a possible future feature? 🙂

@sorki
Copy link

sorki commented Jul 16, 2018

Not really - I'm just trying to point out that the behavior of step seconds is configurable in NTP daemon. Chronyd is just a replacement for NTPD which I'm very happy with for a long time.

@MichaelXavier
Copy link
Owner

BTW there's no chance I'm going to work on this bug fix any time soon but I'd be happy to take a PR.

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

3 participants