Port DST fall-back infinite trigger fix to 3.x (#2865)#2885
Merged
Conversation
When computing next fire time in CronExpression.GetTimeAfter, ambiguous local times during DST fall-back transitions were assigned the DST (summer) UTC offset, resulting in a UTC time that was before the input. This caused triggers to always compute a next fire time in the past, leading to infinite refires. Fix: after computing the UTC result, if it falls before afterTimeUtc and the local time is ambiguous, use the standard (non-DST) offset instead — the minimum of the two ambiguous offsets — which corresponds to the second (post-fallback) occurrence of the ambiguous local time. Adds regression test ShouldNotFireInfinitelyAfterDstFallBackTransition reproducing the Amsterdam/Europe scenario from the issue report. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
lahma
added a commit
that referenced
this pull request
Mar 29, 2026
…After (#2156) The fall-back guard added in #2885 resolved the CronExpression DST issues reported in #2156 and #2475. These tests lock in the fix with coverage for: - IsSatisfiedBy during DST fall-back transition (exact #2156 reproduction) - IsSatisfiedBy with UTC timezone during DST periods - GetTimeAfter monotonicity across fall-back (90-minute walk) - GetTimeAfter monotonicity across spring-forward (90-minute walk) - Full minute-by-minute iteration through October across CET fall-back Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 task
lahma
added a commit
that referenced
this pull request
Mar 29, 2026
The fall-back guard added in #2885 resolved the CronExpression DST issues reported in #2156 and #2475. These tests lock in the fix with coverage for: - IsSatisfiedBy during DST fall-back transition (exact #2156 reproduction) - IsSatisfiedBy with UTC timezone during DST periods - GetTimeAfter monotonicity across fall-back (90-minute walk) - GetTimeAfter monotonicity across spring-forward (90-minute walk) - Full minute-by-minute iteration through October across CET fall-back Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
CronExpression.GetTimeAftercomputed an ambiguous local time during fall-back,GetUtcOffsetpicked the DST offset, producing a UTC result before the input — causing infinite refiresafterTimeUtcand the local time is ambiguous, use the standard (non-DST) offset insteadChanges
src/Quartz/CronExpression.cs— Addedusing System.Linqand post-computation guard inGetTimeAfterto select the standard offset when the DST offset produces a result in the pastsrc/Quartz.Tests.Unit/DaylightSavingTimeTests.cs— Added regression testShouldNotFireInfinitelyAfterDstFallBackTransitionTest plan
🤖 Generated with Claude Code