question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cron triggers fire continuously for hours for some time zones every few milliseconds

See original GitHub issue

Created 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mrnikocommented, Oct 14, 2022
0reactions
mukundansampathcommented, Oct 13, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cron triggers fire continuously for hours for some time zones every ...
Cron triggers fire continuously for hours for some time zones every few milliseconds.
Read more >
Spring's @Scheduled cron job is triggering a few milliseconds ...
The short answer is that you can't with the cron option. The resolution of the cron expressions is to the second so it's...
Read more >
Using the Scheduler Binding Component
Cron : The Cron trigger is a time specific trigger. Using the Cron trigger, you can schedule an action using seconds, minutes, hours,...
Read more >
Quartz Scheduler Developer Guide
CronTrigger is useful if you wish to have triggering based on calendar-like schedules such as “every Friday, at noon” or “at 10:15 on...
Read more >
Introducing Cron Triggers for Cloudflare Workers
Cron Triggers in the context of Workers allow users to set time-based invocations for the job. These Workers happen on a recurring schedule,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found