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

Scheduled task was not triggered after DST #28430

Closed
ifc0 opened this issue May 9, 2022 · 5 comments
Closed

Scheduled task was not triggered after DST #28430

ifc0 opened this issue May 9, 2022 · 5 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid

Comments

@ifc0
Copy link

ifc0 commented May 9, 2022

I am using a scheduled task with annotation:
@Scheduled(cron = "0 30 0 * * ?", zone = "Europe/Bratislava")

This task was successfully triggered every day, but after the Daylight saving time (DST) change, the task did not start on 2022/03/28 at 0.30 AM. The day after (2022/03/29), task was triggered again and continue triggering every day according to cron expression.

Other scheduled task used in application ran properly with annotation below:
@Scheduled(cron = "0 0/5 * * * *", zone = "Europe/Bratislava")

Annotation is used from dependency org.springframework:spring-context:5.3.10

I am struggling to find out why scheduled task did not run. Does anyone know the answer, please?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 9, 2022
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label May 9, 2022
@sbrannen
Copy link
Member

sbrannen commented May 9, 2022

@poutsma, is this a potential duplicate of #28245?

@poutsma
Copy link
Contributor

poutsma commented May 9, 2022

@poutsma, is this a potential duplicate of #28245?

I don't think so, as that particular issue was about jobs not running between 2 and 3 am, something we have never supported. However, there have been a lot of fixes in the area of cron expressions since 5.3.10.

@ifc0 Can you please upgrade to the latest version of Spring Framework, which is currently 5.3.20, and see if the same problem occurs?

@poutsma poutsma added the status: waiting-for-feedback We need additional information before we can continue label May 9, 2022
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label May 16, 2022
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels May 23, 2022
@ifc0
Copy link
Author

ifc0 commented Oct 4, 2022

Sorry for late response. I tried to simulate the problem by running a test with CronExpression, which is used to calculate the next date in scheduled cron jobs:

ZonedDateTime current = ZonedDateTime.parse("2022-03-27T00:30+01:00[Europe/Bratislava]");

CronExpression cronExpression = CronExpression.parse("0 30 0 * * *");
ZonedDateTime next = cronExpression.next(current);
assertEquals("2022-03-28T00:30+02:00[Europe/Bratislava]", next.toString());

This test failed in 5.3.10 version, where is calculated 2022-03-29T00:30+02:00[Europe/Bratislava], but passed in 5.3.20, so this problem seems to be fixed. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

5 participants