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

Fix infinite looping bugs with recurrent tasks around DST #639

Merged
merged 13 commits into from
Mar 5, 2023
Merged

Fix infinite looping bugs with recurrent tasks around DST #639

merged 13 commits into from
Mar 5, 2023

Commits on Mar 5, 2023

  1. Fix infinite loops in _getNextDateFrom when looking for time points i…

    …nside skipped hours/minutes due to DST shifting time forward.
    
    This is done by detecting a forward shift of time, then scanning the skipped range for candidate firing times.
    
    A jumped over job due to DST still fires exactly once, as it should. This firing happens immediately upon shifting time. This also fixes another, less-intrusive bug where a skipped-over time period in DST is not recognized as a firing candidate. (e.g. before: 1:30 -> 3:30, after: 1:30 -> 3:00 -> 3:30 given a 2AM to 3AM forward shift)
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    3277e80 View commit details
    Browse the repository at this point in the history
  2. remove console logs

    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    245c7f2 View commit details
    Browse the repository at this point in the history
  3. Fix infinite loops in _getNextDateFrom when looking for time points i…

    …nside skipped hours/minutes due to DST shifting time forward.
    
    This is done by detecting a forward shift of time, then scanning the skipped range for candidate firing times.
    
    A jumped over job due to DST still fires exactly once, as it should. This firing happens immediately upon shifting time. This also fixes another, less-intrusive bug where a skipped-over time period in DST is not recognized as a firing candidate. (e.g. before: 1:30 -> 3:30, after: 1:30 -> 3:00 -> 3:30 given a 2AM to 3AM forward shift)
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    41baa43 View commit details
    Browse the repository at this point in the history
  4. clean up the _checkTimeInSkippedRange function

    Both to have less while loops and fix what looked like a bug. The bug was undiscovered because it would happen for DST jumps that do not exist in the real world.
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    8dd4610 View commit details
    Browse the repository at this point in the history
  5. add extra tests for covering all cases of '_checkTimeInSkippedRange'.

    This includes presumed jumps that empirically will not happen. These should still be tested because the functions are implemented in such a way that they would presumably still handle them.
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    df27c5e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d95121a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    21fb8c9 View commit details
    Browse the repository at this point in the history
  8. Fix broken logic in the do/while loop for finding the nearest past fo…

    …rward DST jump.
    
    It subtracted hours in the loop for no reason. And there was no loop variable.
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    d1dfa8d View commit details
    Browse the repository at this point in the history
  9. add comments clarifying the purpose of 'beforeJumpingPoint' and 'afte…

    …rJumpingPoint' for `_checkTimeInSkippedRange`.
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    46734fa View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1168c18 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    104e0df View commit details
    Browse the repository at this point in the history
  12. Swap function parameter ordering for `_checkTimeInSkippedRangeMultiHo…

    …ur`. Now represents HH:mm (start), HH:mm (end).
    GijsvandenHoven committed Mar 5, 2023
    Configuration menu
    Copy the full SHA
    68c527e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    41b6fad View commit details
    Browse the repository at this point in the history