-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jobs do not shutdown at application exit #34
Comments
Please describe your environment. Grails version, the plugin version, application server. |
I'm confused, I don't think the plugin has responsibility to do this on exit. Many/most people want the jobs to outlive the app, if the app crashes or restarted the jobs should still be in quartz so they can be recovered? Or is this specifically happening for non-persistent or durable jobs? |
@kefirfromperm - apologies. Grails 2.5.1 on Mac OS X 10.10 Java 8 - tomcat 7.0.55.3. @rvanderwerf - its quite possible, I'm not super familiar with Quartz at this stage - however - if this is the case (the jobs should outlive the application) - how can I detect from within the job that the application is no longer running so it can shut itself down. Using grails run-app / stop-app I would expect it to stop jobs, but I may be wrong. I've also noticed when deploying with Tomcat manager it won't allow the new versions to take over as the old versions will not stop jobs. |
I'd up to the app code to manage this. You have to query jobs and triggers using the quartz API and clean them out if you don't want them anymore. If you do a nice stop, you can add this to your shutdown code as well. Quartz doesn't really provide any auto-management of this out of the box. |
@rvanderwerf OK. Do you have any examples of doing this? I've tried adding blocks of code in the BootStrap destroy methods as well as the onShutdown in plugins config but neither of these methods appear to be triggered at application exit. |
Just checking in here if anyone can assist with this? |
@donald-jackson - did you ever get past this? I'm hitting the same problem. Maybe I'm misunderstanding the entire purpose of the plugin - it seems to bundle quartz and allow it to autostart. if I'm also then stopping the app, I'd want this to cleanly shut down. |
@mgkimsal unfortunately not, I still have the problem I just use other methods to hard-stop my application now as I'm unable to stop these jobs programmitically or automatically. |
…as starting up too early and not spring artifact aware or session bind aware. Also fixes shutdown to properly shutdown before the session gets wiped out from underneath
resolved in 2.0.10 |
When stopping an app (stop-app in development) the Quartz jobs do not stop.
Output from an application here:
Grails 2.5.1 - latest from branch 1.x.
The text was updated successfully, but these errors were encountered: