Skip to content

Spring DST change skips jobs from executing #65

@betelgeuse

Description

@betelgeuse

Requirements:

  • set config[:tz] = timezone or have system clock in non UTC
  • use :at filter in specifications
  • in spring DST change the clock leaps forward

Results:

  • All tasks which execute with long interval like 1.day will skip an invocation

Why:

irb(main):016:0> Time.local(2020,3,29,23).in_time_zone(Time.zone)
=> Mon, 30 Mar 2020 02:00:00 EEST +03:00
irb(main):017:0> Time.local(2020,3,23,0).in_time_zone(Time.zone)
=> Mon, 23 Mar 2020 02:00:00 EET +02:00
irb(main):018:0> Time.local(2020,3,29,23).in_time_zone(Time.zone) - Time.local(2020,3,23,0).in_time_zone(Time.zone) >= 1.week
=> false

Suggested mitigation vectors. Thoughts?

  • Including a warning in README
  • Making the code handle the jump
    • under a configuration option?

I think we can work around this for now in our code that uses clockwork by just lowering the trigger interval. The :at filter should make sure they trigger correctly.

This also answer the question in #37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions