Open ThorbenLindhauer opened 3 years 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...
What's a shutdown url?
This issue was imported from JIRA:
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):
org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.setAwaitTerminationSeconds(int)
onThreadPoolTaskExecutor
)org.springframework.scheduling.concurrent.ExecutorConfigurationSupport.setWaitForTasksToCompleteOnShutdown(boolean)
onThreadPoolExecutor
; note that this will also wait for all queued jobs to complete); note that thread interruption can let executing jobs failSystem#exit
)Limitations of Scope (Optional):
Runtime#halt
or the machine crashing)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: