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

CronSequenceGenerator - Friday 13th issue [SPR-17036] #21574

Closed
spring-projects-issues opened this issue Jul 13, 2018 · 3 comments
Closed

CronSequenceGenerator - Friday 13th issue [SPR-17036] #21574

spring-projects-issues opened this issue Jul 13, 2018 · 3 comments
Assignees
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 13, 2018

Lauri Kimmel opened SPR-17036 and commented

Unit test below is failing with message
Overflow in day for expression "0 0 0 13 * FRI"

    public void testFriday13Failure() {

        String cronExpression = "0 0 0 13 * FRI";

        assertThat(CronSequenceGenerator.isValidExpression(cronExpression), is(true));

        CronSequenceGenerator gen = new CronSequenceGenerator(cronExpression);

        Instant instant = Instant.parse("2018-07-13T11:47:14Z");

        gen.next(Date.from(instant));

    }

2018-07-13 is Friday 13th;
2019-09-13 is next Friday 13th;
there are 427 days between which is exceeding max limit 366 in CronSequenceGenerator.findNextDay().


Affects: 4.3.10

Issue Links:

  • #13621 Cron expression with fixed weekday and fixed date may or may not lead to IllegalStateException (runaway search for next trigger)
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 13, 2018

Lauri Kimmel commented

Although tested with version 4.3.10 I'm assuming it's affecting newer releases as well since implementation has not been changed for years.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 13, 2018

Lauri Kimmel commented

Looks to be related to #13621.

@sbrannen
Copy link
Member

@sbrannen sbrannen commented Jul 14, 2020

I have confirmed that this is a bug when running the supplied test against master.

@sbrannen sbrannen added this to the 5.x Backlog milestone Jul 14, 2020
@poutsma poutsma self-assigned this Jul 24, 2020
@poutsma poutsma modified the milestones: 5.x Backlog, 5.3 M2 Jul 24, 2020
@poutsma poutsma closed this in dbec16d Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.