Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Database restart not handled gracefully #446

Closed
timsuchanek opened this issue Jan 27, 2020 · 3 comments
Closed

Database restart not handled gracefully #446

timsuchanek opened this issue Jan 27, 2020 · 3 comments
Assignees
Labels
kind/improvement An improvement to existing feature and code.
Milestone

Comments

@timsuchanek
Copy link
Contributor

I use a Postgres database and have a Node.js web server running with Prisma Client, pointing to it.
If I restart my Postgres database, it's not available for a couple of seconds.
The query engine then exits.
Prisma Client from then on errors, that the engine exited.
I would like Prisma Client and the query engine to be more resilient in this situation and have a longer timeout so that the application doesn't crash immediately.

@timsuchanek timsuchanek added process/candidate Candidate for next Milestone. kind/improvement An improvement to existing feature and code. labels Jan 27, 2020
@pimeys
Copy link
Contributor

pimeys commented Jan 28, 2020

Updating the pool to a later version and testing with it:

prisma/quaint#69

Now when prisma is open and one kills the database, some of the threads will crash and restart in tokio, some requests will get errors and when the database is back up, the connections will be back up. It needs to be decided what the client should do in a situation when the we get connection errors and crashing threads in QE. It can heal itself, but of course a situation when the database goes down would be one where we'd expect everything to panic and raise alarms.

Now QE will panic and yell when it happens, but will also heal itself hopefully in a good condition.

@pimeys
Copy link
Contributor

pimeys commented Jan 28, 2020

@timsuchanek merged to alpha.

@janpio janpio added this to the Preview 22 milestone Jan 31, 2020
@janpio janpio removed the process/candidate Candidate for next Milestone. label Jan 31, 2020
@timsuchanek
Copy link
Contributor Author

This is implemented in the latest alpha.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/improvement An improvement to existing feature and code.
Projects
None yet
Development

No branches or pull requests

4 participants