Spring Scheduler stops unexpectedly

前端 未结 3 438
孤城傲影
孤城傲影 2020-12-13 02:02

We have a Spring 3 web application on Tomcat 6 that uses several scheduled services via @Scheduled (mainly for jobs that run every night). Now it appears that s

3条回答
  •  独厮守ぢ
    2020-12-13 02:53

    This is pretty easy to find out. You would be doing this with a stack trace. There are many posts on how to get a stack trace, on unix system you do 'kill -3 ' and the stack trace appears in the catalina.out log file.

    Once you have a stack trace, find the scheduler thread and see what it is doing. Is it possible that the task it was executing got stuck?

    you can also post the stack trace here for more help.

    what is important to know is what scheduler you use. if you use the SimpleAsyncTaskExecutor, it will start a new thread for each task, and your scheduling will never fail. However, if you have tasks that don't finish, you will run out of memory eventually.

    http://docs.spring.io/spring/docs/3.0.x/reference/scheduling.html

提交回复
热议问题