Cron triggers fire continuously for hours for some time zones every few milliseconds
See original GitHub issueCreated a Redisson Cron tigger for the Australia/Sydney time zone that will fire at 6PM every day, every week. Cron Expression - 0 0 18 ? * 2,3,4,5,6,7,1 Timezone - Australia/Sydney
Expected behavior Expected that the trigger will fire at 18 every day for sydney only once
Actual behavior With redisson version - 3.17.5 the trigger fires at 18 sydney as expected. But it doesnt stop firing. It fires every few millis for hours together and this drains all our server resources. Are cron expressions evaluated differently now? This was working as expected with redisson version - 3.16.4. We recently upgraded to 3.17.5 and started seeing this issue
Steps to reproduce or test case
Create a simple cron trigger for sydney that fires every day at 6Pm with the below call -
RScheduledExecutorService.schedule(Runnable task, CronSchedule cronSchedule);
Code snippet -
final String cronExpr = "0 0 18 ? * 2,3,4,5,6,7,1"; CronSchedule cronSchedule = CronSchedule.of(cronExpr, ZoneId.of("Australia/Sydney")); RScheduledExecutorService executor = redisson.getExecutorService(name(), config.codec(), config.executorOptions()); executor.schedule(task, cronSchedule);
With 3.16.4 the code was -
final String cronExpr = "0 0 18 ? * 2,3,4,5,6,7,1"; CronSchedule cronSchedule = CronSchedule.of(cronExpr); cronSchedule.getExpression().setTimeZone(TimeZone.getTimeZone(ZoneId.of("Australia/Sydney"))); RScheduledExecutorService executor = redisson.getExecutorService(name(), config.codec(), config.executorOptions()); executor.schedule(task, cronSchedule);
Redis version redis-server -v Redis server v=7.0.0 sha=00000000:0 malloc=libc bits=64 build=fa9ffba7836907da
Redisson version 3.17.5
Redisson configuration int workers = 10; int executorThreads = 10; long taskRetryIntervalSeconds = TimeUnit.MINUTES.toSeconds(10); long defaultTaskTimeoutSeconds = TimeUnit.HOURS.toSeconds(8);
private int redissonTimeout = 6000;
private int redissonRetryAttempts = 6;
private int redissonRetryInterval = 3000;
private int redissonPingConnectionInterval = 50000;
private long redissonDnsMonitorInterval = 60000;
private int redissonSubscriptionPoolSize = 100;
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:6 (3 by maintainers)

Top Related StackOverflow Question
Fixed in https://github.com/redisson/redisson/commit/2e874b085a207d3977b7abdaea88020bf3932f47. Thanks for report
Hi @mrniko Tried this out. Initial testing is positive. The trigger fires just once for the given time zone for the specified hh:mm. Thanks