java - Spring schedule graceful shutdown not working when using a cron scheduled -


i have small standalone application configures scheduler terminate gracefully. following configuration:

@bean public taskscheduler taskscheduler() {     threadpooltaskscheduler scheduler = new threadpooltaskscheduler();     scheduler.setwaitfortaskstocompleteonshutdown(true);     scheduler.setawaitterminationseconds(60);     return scheduler; } 

i can gracefully terminate scheduler, if don't have @scheduled(cron = ) task. once have 1 of those, no matter scheduler stuck until timeout. tried configuring executor , shutdown/await manually , effect same.

these cron jobs not running. set run @ fixed time during night example.

spring version: 4.2.8.release

this happen when timeout reaches end:

2017.07.28 01:44:56 [thread-3] warn  timed out while waiting executor 'taskscheduler' terminate 

any thoughts?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -