Skip to content

Are scheduler tasks still active when ShutdownEvent is fired #34807

Answered by mkouba
bulldog98 asked this question in Q&A
Discussion options

You must be logged in to vote

Nope, this is not guaranteed.

In general, the ShutdownEvent is fired before the CDI container (ArC) is shut down so that a bean can observe this event and the scheduler (either the impl from quarkus-scheduler or from quarkus-quartz) is shut down after the CDI application/singleton contexts are destroyed. Moreover, a scheduled task can be running during the shutdown.

Finally, if the quarkus.quartz.shutdown-wait-time config property is set to a non-zero value, then Quarkus will attempt to wait for all running jobs to finish (quarkus-quartz only).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by bulldog98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants