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 with spring #38

Closed
ESAStackAdmin opened this issue Mar 2, 2021 · 0 comments · Fixed by #52
Closed

Graceful shutdown with spring #38

ESAStackAdmin opened this issue Mar 2, 2021 · 0 comments · Fixed by #52
Labels
bug Something isn't working
Milestone

Comments

@ESAStackAdmin
Copy link
Contributor

Expected behavior

Restlight should be shut down before closing Spring context.

Actual behavior

Restlight does the graceful shutdown by adding an individual shutdown hook, which has a different lifecycle from Spring's shutdown hook. This would cause errors when invoking the controller methods because the beans these methods belong to would have been destroyed in Spring's shutdown hook if Spring's shutdown hook is executed before Restlight's shutdown hook.

Runtime.getRuntime().addShutdownHook(new Thread(this::shutdown, "shutdown-hook-thread"));

Maybe we should bind the shutdown hook lifecycle with Spring context(if it is in Spring env).

Steps to reproduce

see above

Env

  • Restlight version: 0.1.0
@ESAStackAdmin ESAStackAdmin added the bug Something isn't working label Mar 2, 2021
@Mkabaka Mkabaka added this to the v0.1.1 milestone Apr 29, 2021
@Mkabaka Mkabaka closed this as completed May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants