camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.1k stars 1.55k forks source link

When shutting down a Spring Boot application orderly, the job executor is shut down gracefully #2626

Open ThorbenLindhauer opened 3 years ago

ThorbenLindhauer commented 3 years ago

This issue was imported from JIRA:

Field Value
JIRA Link CAM-13498
Reporter @ThorbenLindhauer
Has restricted visibility comments true

User Story (Required on creation):

If process execution can be interrupted at any point during shutdown, this can lead to application states that are hard to repair, especially when interacting with external systems.

Examples:

The goal of this feature request is to make such states less likely by employing a more ordered shutdown (such as letting executing jobs finish). However, it will not rule out the general possibility of such inconsistent states.

Functional Requirements (Required before implementation):

Technical Requirements (Required before implementation):

Limitations of Scope (Optional):

Hints (Optional):

Graceful shutdown is supported with all four embedded web servers (Jetty, Reactor Netty, Tomcat, and Undertow) and with both reactive and Servlet-based web applications. When a grace period is configured, upon shutdown, the web server will no longer permit new requests and will wait for up to the grace period for active requests to complete. {quote}

Links:

j-lindner commented 1 year ago

Maybe to consider, when implementing: A customer has given us the following note (via https://jira.camunda.com/browse/SUPPORT-15822):

I think the best solution would be a shutdown url, which would be called before the normale jvm shutdown will be triggered and will stop the jobexecutor in a normal jvm status. Or maybe I can customized the gracefull shutdown of spring, so that it also wait for the camunda jobs, I don´t know...

ThorbenLindhauer commented 1 year ago

What's a shutdown url?