Affects: 6.1.6
Context: LifecycleProcessor / DefaultLifecycleProcessor
We would like to have the possibility to change the timeoutPerShutdownPhase for specific phases. During the graceful shutdown, we have processes where we have to wait longer than the default timeout. But we cannot just change the default timeoutPerShutdownPhase, because of long-running http requests running, which should be cancled in default time.
I would be happy to provide a pull request if you'd like.
Comment From: jhoeller
Making individual timeouts configurable per specific phase sounds good to me. We need to make up our mind on how to design the methods for configuring these, e.g. a setTimeoutsForShutdownPhases(Map<Integer, Long>
(which we would traditionally do for an XML setup style) or something nicer for programmatic use in an @Bean
method.
In any case, this fits nicely into 6.2 where we refine some lifecycle defaults already: https://github.com/spring-projects/spring-framework/issues/32152
Comment From: ansgarschulte
I build a custom LifecycleProcessor for this use case by providing setTimeoutsForShutdownPhases. That works pretty well