Multiple Spring scheduled tasks triggered at the same time

Viewed 49

I have multiple scheduled tasks, triggered by a CRON expression, at the same time:

@Scheduled(cron = "0 30 3 * * MON")
public void weeklyReport() {...}

@Scheduled(cron = "0 30 3 * * *")
public void dailyReport() {...}

@Scheduled(cron = "0 00 5 * * MON")
public void weeklyEmail() {...}

@Scheduled(cron = "0 00 5 * * *")
public void dailyEmail() {...}

dailyReport and dailyEmail are scheduled every day at 3:30am and 5:00am respectively.

weeklyReport and weeklyEmail are scheduled every monday at 3:30am and 5:00am respectively.

The issue occurs on monday, when there are two tasks (supposed to be) triggered.

In my case, weeklyReport is never triggered, but weeklyEmail and dailyEmail, which are both scheduled at 5:00am, are successfully triggered.

I need to precise that I don't override the pool size (default is 1).

My questions are:

  • What is the execution order when the pool size is 1 and multiple tasks should be triggered at the same time?
  • Do you have any idea why one of the scheduled tasks is not triggered?
0 Answers
Related