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

Dagrun "skipped" for timezone aware DAGs with schedules affected by daylight saving time #38098

Open
2 tasks done
wolfier opened this issue Mar 13, 2024 · 2 comments
Open
2 tasks done
Labels
area:core area:Scheduler including HA (high availability) scheduler kind:documentation

Comments

@wolfier
Copy link
Contributor

wolfier commented Mar 13, 2024

What do you see as an issue?

The issue is that users are unaware of scheduling behaviour between transition of when daylight saving time is observed and when it is not.

For daylight time saving observing timezones, at the cusp of when switching between when daylight saving time is NOT observed to when it is, there is an hour that does not exist. For example, 2 AM Central Time ("America/Chicago") does not exist on March 10th 2024.

  • 2024-03-10 7:59 UTC is 1:59 AM CT (CST)
  • 2024-03-10 8:00 UTC is 3:00 AM CT (CDT)
  • 2024-03-10 8:01 UTC is 3:01 AM CT (CDT)

For daylight time saving observing timezones, at the cusp of when switching between when daylight saving time is observed to when it is NOT, there is an hour that is repeated. For example, 1 AM Central Time ("America/Chicago") happens twice on November 3rd 2024.

  • 2024-11-03 6:59 UTC is 1:59 AM CT (CDT)
  • 2024-11-03 7:00 UTC is 1:00 AM CT (CDT)
  • 2024-11-03 7:01 UTC is 1:01 AM CT (CST)
  • 2024-11-03 7:59 UTC is 1:59 AM CT (CST)
  • 2024-11-03 8:00 UTC is 2:00 AM CT (CST)
  • 2024-11-03 8:01 UTC is 2:01 AM CT (CST)

Solving the problem

A description of the effects of these impacted schedule intervals in terms of dagrun creation as that is what drives task scheduling. Without a dagrun, there are no tasks.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@wolfier wolfier added kind:bug This is a clearly a bug kind:documentation needs-triage label for new issues that we didn't triage yet labels Mar 13, 2024
@lopezvit
Copy link

I'll try to get back to this in the future if I have time, trying to provide a better working example where this is happening, but basically these are the steps to reproduce:

  1. Create a DAG with:
  2. catchup=True
  3. hourly schedule (e.g. schedule_interval="1 5-19 * * *")
  4. start_date with a DST aware timezone in the past (e.g.: "start_date": pendulum.datetime(2020, 1, 8, 11, 8, tz="Europe/Helsinki")
  5. Schedule said DAG

It will try to catchup until the Sunday 25th of October 2020, but wont continue with the catchup after that, totally preventing the operation.
As a workaround until this is fixed I changed to the fix timezone:
"start_date": pendulum.datetime(2020, 1, 8, 11, 8, tz=2)
Notes: maybe it is not necessary that it is daily and probably it doesn't need to start in January, but that is what I've find that it reproduces it.

@shahar1 shahar1 added area:Scheduler including HA (high availability) scheduler area:core and removed needs-triage label for new issues that we didn't triage yet kind:bug This is a clearly a bug labels Jul 13, 2024
@shahar1
Copy link
Contributor

shahar1 commented Jul 13, 2024

@wolfier Would you still like to work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core area:Scheduler including HA (high availability) scheduler kind:documentation
Projects
None yet
Development

No branches or pull requests

3 participants