Quartz trigger suddenly changes to ERROR state

7,565 views
Skip to first unread message

Jefferson Carpenter

unread,
Dec 18, 2013, 7:02:56 PM12/18/13
to quar...@googlegroups.com
I've got some Quartz CRQN triggers that fire normally for several hours or days, and then at random stop firing and go into the ERROR state.

Having set the Common.Logging log level to All, I can see logs about Quartz firing triggers and handling misfires, but there are no logs that explain why my triggers go into the ERROR state.

I can get my jobs to start running again by changing the text of the TRIGGER_STATE column back from ERROR to WAITING.  However, I would much rather understand and fix the actual problem than just apply a band-aid like this.


According to google, people have had similar problems in the past.

This problem can be caused when your running instance cannot find the job class to instantiate.  According to a blog post, I should expect a message in the Quartz logs when this happens.  There's no such message in the logs, so I doubt this is my problem.

This problem can happen when you get out-of-memory errors while Quartz is busy firing a trigger.  I have verified that my memory usage is quite reasonable.

People have mentioned that it's bad when jobs throw unhandled exceptions.  I'm not 100% sure that my jobs don't throw unhandled exceptions, but the code I'm calling in my jobs is well-used and pretty robust.  And anyway, having read some Quartz documentation and run some tests on my machine, it looks like exception-throwing jobs do not cause their triggers to go into the ERROR state.


Any ideas why Quartz might not be logging the problem that's putting the triggers into the ERROR state?

Or what else could cause a trigger to go into the ERROR state?

Marko Lahma

unread,
Dec 22, 2013, 5:14:21 AM12/22/13
to quar...@googlegroups.com
Are you doing some logic in job's constructor? I've seen people
instantiating db contexts and whatnot and that causing exceptions
which lead to marking job's all triggers to error state.

General rule (for object-oriented programming), do not throw
exceptions from constructors.

-Marko

On 12/19/13, Jefferson Carpenter <jefferson...@gmail.com> wrote:
> I've got some Quartz CRQN triggers that fire normally for several hours or
> days, and then at random stop firing and go into the ERROR state.
>
> Having set the Common.Logging log level to All, I can see logs about Quartz
>
> firing triggers and handling misfires, but there are no logs that explain
> why my triggers go into the ERROR state.
>
> I can get my jobs to start running again by changing the text of the
> TRIGGER_STATE column back from ERROR to WAITING. However, I would much
> rather understand and fix the actual problem than just apply a band-aid
> like this.
>
>
> According to google, people have had
> similar<https://forums.terracotta.org/forums/posts/list/2881.page>
> problems<http://stackoverflow.com/questions/618265/quartz-scheduler-suddenly-stop-running-and-no-exception-error>in
> the past.
>
> This problem can be caused when your running instance cannot find the job
> class to instantiate. According to a blog
> post<http://mail2vks.blogspot.com/2012/05/quartz-scheduler-trigger-in-error-state.html>,
>
> I should expect a message in the Quartz logs when this happens. There's no
>
> such message in the logs, so I doubt this is my problem.
>
> This problem can happen when you get out-of-memory errors while Quartz is
> busy firing a trigger. I have verified that my memory usage is quite
> reasonable.
>
> People have mentioned that it's bad when jobs throw unhandled exceptions.
> I'm not 100% sure that my jobs don't throw unhandled exceptions, but the
> code I'm calling in my jobs is well-used and pretty robust. And anyway,
> having read some Quartz
> documentation<http://quartz-scheduler.org/documentation/best-practices#jobs>and
> run some tests on my machine, it looks like exception-throwing jobs do
> not cause their triggers to go into the ERROR state.
>
>
> Any ideas why Quartz might not be logging the problem that's putting the
> triggers into the ERROR state?
>
> Or what else could cause a trigger to go into the ERROR state?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Quartz.NET" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to quartznet+...@googlegroups.com.
> To post to this group, send email to quar...@googlegroups.com.
> Visit this group at http://groups.google.com/group/quartznet.
> For more options, visit https://groups.google.com/groups/opt_out.
>

许涵洋

unread,
Sep 16, 2014, 2:17:05 AM9/16/14
to quar...@googlegroups.com
Hi, Jefferson

Do you solve the issue ? I also find the same problem
Reply all
Reply to author
Forward
0 new messages