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.

Quarkus quartz should not reschedule jobs on start

See original GitHub issue

Describe the bug

Bug introduced by https://github.com/quarkusio/quarkus/issues/20538

Anytime quarkus starts it will reschedule jobs, not matter if the job config changed or not. It’s a tough decision, at best it should only detect changes and WARN, nothing else. This can have serious collateral damages depending on what your jobs are doing.

If you are cleaning up your data once a year, you don’t want that to be re initialized and triggered every time you restart the app or scale up your cluster.

Expected behavior

Do not reschedule jobs, WARN or maybe improve the dev tools but this is too dangerous.

Actual behavior

All jobs are rescheduled on start.

How to Reproduce?

Pick any quartz based clustered app. Create a job running every 5 sec for example.

Request the db for select * from qrtz_simple_triggers and select * from qrtz_triggers

Restart the app and check the table again. All triggers, executions are reset, ignoring past execution and, most important, the expected and persistent next_fire_time on qrtz_triggers.

Output of uname -a or ver

no impact

Output of java -version

no impact

GraalVM version (if different from Java)

No response

Quarkus version or git rev

since 2.3.1

Build tool (ie. output of mvnw --version or gradlew --version)

no impact

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ashwinaircommented, Jan 7, 2022

It would be helpful if you can share some follow-ups for me, Thanks.

You mean followup issues? If yes, let’s get this one in and we can look for others together I’ve couple of ideas.

Ya, sure it would be good for me too as I get to learn about quarkus more.

sorry for replying late, actually I was trying to fix my quarkus setup issues first before submitting my first pull request that’s why. can you check it out? #22717 Thanks 😃

1reaction
mkoubacommented, Nov 23, 2021

@machi1990 I think that solution 1 makes sense. What other state is lost BTW?

Whenever you change the @Scheduled.identity, remove the @scheduled annotation, quarkus is not in charge of cleaning up the qrtz_ tables related rows, this must be handled by the migration scripts (flyway), or manually.

@apat59 +1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scheduling Periodic Tasks with Quartz - Quarkus
In this guide, you learn how to schedule periodic clustered tasks using the Quartz extension. This technology is considered preview. In preview, backward ......
Read more >
Scheduling Periodic Tasks with Quartz - Quarkus
By default, the scheduler is not started unless a @Scheduled business method is found. You may need to force the start of the...
Read more >
Quarkus Camel SFTP route Quartz schedule not starting
QuartzScheduler ] (Quarkus Main Thread) No scheduled business methods found - Quartz scheduler will not be started. I expected it to start ......
Read more >
Examples - Quartz Scheduler
As of version 1.5, Quartz ships with 13 out-of-the-box examples that ... Example 5 - Handling Job Misfires, Sometimes job will not execute...
Read more >
Dynamic Job Scheduling Using Quartz Scheduler and RRule
Quartz is an advanced and powerful dynamic job scheduling framework (open source). It allows software developers to schedule jobs at a ...
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