-
-
Notifications
You must be signed in to change notification settings - Fork 147
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
Daylight Savings Time Bug #321
Comments
@weixiyen Thanks for reporting. Which timezone have you configured? |
I think that the problem is caused by the line https://github.com/c-rack/quantum-elixir/blob/51f30540a491c8fcdcb221c8d75540894ff6e6cc/lib/quantum/execution_broadcaster.ex#L197 I‘ll work on a fix for the problem tomorrow. |
👍 |
I could not yet reproduce the problem. I'll keep you posted. |
Just to follow up on the timezone question it was "America/New_York" |
I'm able to reproduce the issue now. I need to find the exact cause to find the issue. If a job in a local timezone jumps over an hour the issue will occur. The only fix right now is to use UTC in the jobs. I'm going to fix the issue before the DST ends in Europe (on Sunday). If you have jobs that are running in a TZ in Europe, please follow this issue and update as soon as the fix is out. |
The problem seems to be created in the function Given a job in the timezone
|
A solution needs to consist of two parts:
Does someone have an idea how to solve This is the function that needs to be patched for defp add_job_to_state(
%Job{schedule: schedule, timezone: timezone, name: name} = job,
%{time: time} = state
) do
schedule
|> Scheduler.get_next_run_date(DateLibrary.to_tz!(time, timezone))
|> case do
{:ok, date} ->
add_to_state(state, DateLibrary.to_utc!(date, timezone), job)
_ ->
Logger.warn("""
Invalid Schedule #{inspect(schedule)} provided for job #{inspect(name)}.
No matching dates found. The job was removed.
""")
state
end
rescue
e in JobInPastError ->
stacktrace = System.stacktrace()
reraise(e, stacktrace)
error ->
Logger.error(
"Invalid Timezone #{inspect(timezone)} provided for job #{inspect(name)}.",
job: job,
error: error
)
state
end |
Will be released with #324 |
Got an argument error :erlang.send_after error in execution_broadcaster.ex during daylight savings time. Seems like the time -576462949368 is very far off during DST.
I'm on v 2.2.3.
The text was updated successfully, but these errors were encountered: