spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Errors thrown from SmartLifeycle#stop results in (unnecessary) waiting for the shutdown timeout

Open joshiste opened this issue 1 year ago • 0 comments

When the stop method of a SmartLifecycle bean throws an error, the DefaultLifecycleProcessor always waits until the timeout is hit. Which is unnecessary as no cleanup is performed and delays the shutdown.

Imho when calling the stop() method the DefaultLifecycleProcessor should also do a latch.countDown in case an exception is thrown.

(In our case we had a stop method which was interacting with the database. When we did some DB failover testing, this method has thrown some exception and the shutdown got delayed)

joshiste avatar Aug 28 '24 14:08 joshiste