GNU bug report logs - #75622
shepherd docs: Do timers work on DST/TZ changes?

Previous Next

Package: guix;

Reported by: Paweł Zmarzły <pawo2500 <at> gmail.com>

Date: Fri, 17 Jan 2025 05:20:02 UTC

Severity: normal

To reply to this bug, email your comments to 75622 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#75622; Package guix. (Fri, 17 Jan 2025 05:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paweł Zmarzły <pawo2500 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Fri, 17 Jan 2025 05:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paweł Zmarzły <pawo2500 <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: shepherd docs: Do timers work on DST/TZ changes?
Date: Thu, 16 Jan 2025 20:00:11 +0000
I am considering using shepherd timers as crontab replacement. But I
want to first make sure they work correctly on time, timezone and
daylight-saving changes. In my experience with systemd, it can truly
be a minefield, e.g.

https://github.com/systemd/systemd/issues/5595 - timers not running on
the day of DST change

https://github.com/systemd/systemd/issues/8647 - timers not running
for entire hour after DST change

https://github.com/systemd/systemd/issues/8233 - timers running in
wrong timezone

https://github.com/systemd/systemd/issues/16732 - editing a timer
leads to its spurious trigger

I also recall many bugs with RandomizedDelaySec, but shepherd and cron
have no equivalent feature, so ignoring that.

Can someone confirm that shepherd timers do not have the same bugs?
And if so, make a note about that in the user manual? Thanks.




Information forwarded to bug-guix <at> gnu.org:
bug#75622; Package guix. (Sun, 19 Jan 2025 18:37:02 GMT) Full text and rfc822 format available.

Message #8 received at 75622 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Paweł Zmarzły <pawo2500 <at> gmail.com>
Cc: 75622 <at> debbugs.gnu.org
Subject: Re: bug#75622: shepherd docs: Do timers work on DST/TZ changes?
Date: Sun, 19 Jan 2025 19:35:59 +0100
Hi,

Paweł Zmarzły <pawo2500 <at> gmail.com> skribis:

> I am considering using shepherd timers as crontab replacement. But I
> want to first make sure they work correctly on time, timezone and
> daylight-saving changes. In my experience with systemd, it can truly
> be a minefield, e.g.

[...]

> Can someone confirm that shepherd timers do not have the same bugs?

Unfortunately those bugs exist as of Shepherd 1.0.1.

The main issue is that the timer waits like this (from (shepherd service
timer)):

            (get-message* channel (seconds-to-wait event)
                          'timeout 'overslept)

where ‘seconds-to-wait’ naively assumes there won’t be DST or timezone
changes in the interim:

  (define (seconds-to-wait event)
    "Return the number of seconds to wait before the next occurrence of
  @var{event} (the result is an inexact number, always greater than zero)."
    (let* ((now (current-time time-utc))
           (then (next-calendar-event event (time-utc->date now)))
           (diff (time-difference (date->time-utc then) now)))
      (+ (time-second diff)
         (/ (time-nanosecond diff) 1e9))))

It would be possible for ‘seconds-to-wait’ to account for forthcoming
DST changes; that should be fixed (mcron seems to get that right).

As for timezone updates (other than DST, meaning: when traveling),
shepherd would need to be notified somehow, and I’m not sure whether
there exists a standard (non-Freedesktop) way to get that info.

Suggestions welcome!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#75622; Package guix. (Mon, 20 Jan 2025 16:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 75622 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Paweł Zmarzły <pawo2500 <at> gmail.com>
Cc: 75622 <at> debbugs.gnu.org
Subject: Re: bug#75622: shepherd docs: Do timers work on DST/TZ changes?
Date: Mon, 20 Jan 2025 17:47:46 +0100
Ludovic Courtès <ludo <at> gnu.org> skribis:

> It would be possible for ‘seconds-to-wait’ to account for forthcoming
> DST changes; that should be fixed (mcron seems to get that right).

I believe this is fixed by Shepherd commit
63075c995da26379719cb9a96785a89a3b4e6943.

Please feel free to take a look and report about anything that looks
fishy (there are several test cases specifically about handling DST
changes.)

Ludo’.




This bug report was last modified 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.