You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking through the codebase, I noticed that Time.now is used to calculate the remaining time to sleep between the iterations of the delayed job processing loop.
This could result in undefined behaviour, as Time.now reports wall time, which could change and get updated at any point.
Looking through the codebase, I noticed that
Time.now
is used to calculate the remaining time to sleep between the iterations of the delayed job processing loop.This could result in undefined behaviour, as
Time.now
reports wall time, which could change and get updated at any point.This is the code I'm talking about: https://github.com/resque/resque-scheduler/blob/master/lib/resque/scheduler.rb#L416
If the system's time was updated and moved backward one hour between the two calls to
Time.now
, the scheduler would sleep for one hour.One way to mitigate this issue would be to use monotonic time to measure the remaining seconds to sleep like so:
The text was updated successfully, but these errors were encountered: