Skip to content
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

Graceful shutdown timeout configuration ignored #2037

Closed
mbrkic4 opened this issue Nov 11, 2020 · 5 comments
Closed

Graceful shutdown timeout configuration ignored #2037

mbrkic4 opened this issue Nov 11, 2020 · 5 comments

Comments

@mbrkic4
Copy link

mbrkic4 commented Nov 11, 2020

Setting graceful shutdown timeout via property "spring.lifecycle.timeout-per-shutdown-phase" doesn't work, default value (30s) is always used. Sample that reproduces the problem is attached. Timeout in sample is set to 60 seconds, but it occures after 30 seconds ("o.s.c.support.DefaultLifecycleProcessor : Failed to shut down 1 bean with phase value 2147483647 within timeout of 30000ms: [webServerGracefulShutdown]".

spring-cloud-gateway-demo.zip

@mbrkic4
Copy link
Author

mbrkic4 commented Nov 11, 2020

It seems that org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration is not working

@spencergibb
Copy link
Member

Workout having looked at the sample yet, what does this have to do with Spring Cloud?

@mbrkic4
Copy link
Author

mbrkic4 commented Nov 11, 2020

It works with minimal spring boot app, but not with minimal spring cloud gateway

@ctlove0523
Copy link
Contributor

@mbrkic4
please update your spring boot version to 2.3.4.RELEASE it will works well.

spring.lifecycle.timeout-per-shutdown-phase=20s

log output:

2020-11-18 11:13:46.068  INFO 11444 --- [       Thread-7] o.s.b.w.embedded.netty.GracefulShutdown  : Commencing graceful shutdown. Waiting for active requests to complete
2020-11-18 11:14:06.071  INFO 11444 --- [       Thread-7] o.s.c.support.DefaultLifecycleProcessor  : Failed to shut down 1 bean with phase value 2147483647 within timeout of 20000ms: [webServerGracefulShutdown]
2020-11-18 11:14:06.080  INFO 11444 --- [ netty-shutdown] o.s.b.w.embedded.netty.GracefulShutdown  : Graceful shutdown aborted with one or more requests still active

@mbrkic4
Copy link
Author

mbrkic4 commented Nov 18, 2020

Yes, this solves it, thanks!

@mbrkic4 mbrkic4 closed this as completed Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants