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

Support for graceful shutdown / DB conn. termination? #20

Open
wh4everest opened this issue Mar 12, 2019 · 1 comment
Open

Support for graceful shutdown / DB conn. termination? #20

wh4everest opened this issue Mar 12, 2019 · 1 comment
Labels
backend enhancement New feature or request question Further information is requested

Comments

@wh4everest
Copy link
Contributor

The PG pool opens connections towards the database. When the app is killed, or when a script finishes, these aren't gracefully terminated and we get these messages:

db_1          | 2019-03-12 12:55:42.030 UTC [9527] xxx@xxx LOG:  could not receive data from client: Connection reset by peer
db_1          | 2019-03-12 12:55:42.030 UTC [9528] xxx@xxx LOG:  could not receive data from client: Connection reset by peer
db_1          | 2019-03-12 12:55:42.033 UTC [9529] xxx@xxx LOG:  could not receive data from client: Connection reset by peer

This isn't causing functional problems, but it's not ideal either.

There are other examples where we want to react to the termination of the program -- maybe stop accepting new requests and wait for active ones to finish?

What would be the correct way for the framework to support graceful shutdowns?

@wh4everest wh4everest added enhancement New feature or request question Further information is requested backend labels Mar 12, 2019
@spion-h4
Copy link
Collaborator

app.getSingleton(AppEvents).onAppShutdown(callback); event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants