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
Restart engine on panic #2100
Comments
I dig a bit and I have some findings:
|
+1 for this. I just tested the
If I don't connect it myself, then it connects on first request,
I'm disconnecting purposefully because last night I saw a lot of zombie processes during a little benchmark of prisma2. It's already half slower than the prisma 1 in that case just because we have to avoid the panic. However, repeated queries are fast (even faster) enough, but the engine panic still remains an issue,
Zombie ProcessI posted this over the prisma.slack.com thread, |
@Sytten : If there's a panic during request execution the engine process will not die. The only panics that may kill the process are the ones that happen before the server has finished starting. |
@mavilein I was discussing it with @timsuchanek and he explain that, but my whole premise is based on the experience I had on a panic that crashed the rust process. It is probably fixed now, but I still think that it can happen until the Neon binding is implemented. Meaning that if the child dies in the JS code, it should be restarted (if the client wants that).
|
I am running into an issue with limited memory with a large database and exposing queries pubically. The result is the query engine dieing when memory runs out which is to be expected then all future request failing due to the query engine being dead. While I should limit request so they don't end up this large of someone does find a request that kills the engine it would be nice if that engine didn't require a manual restart of the application. |
engine crash and never come back findMany( |
Thanks a lot for reporting 🙏 In case it’s not fixed for you - please let us know and we’ll reopen this issue! |
Oh very interesting. Gonna test out. |
Will test it too this weekend. |
Problem
As I understand it, if the engine panics during a request, the client will be rendered nonoperational. Since I only create one client for my application (shared via the Context in an Apollo server), it would mean that the service would need to be restarted. This is problematic for uptime since it would affect other customers that have queries that work.
Solution
It would be best if the client would restart the engine automatically. Otherwise it would be best to document that we need to create a client or call connect for each request.
Additional context
This is needed for a production deployment since errors will happen and they need to be not catastrophic.
The text was updated successfully, but these errors were encountered: