Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

🐞 Fatal error handling when using Diesel #5

Open
mwnDK1402 opened this issue Jun 17, 2021 · 2 comments
Open

🐞 Fatal error handling when using Diesel #5

mwnDK1402 opened this issue Jun 17, 2021 · 2 comments

Comments

@mwnDK1402
Copy link

When too many database connections are started, Diesel produces this error:

[ERROR r2d2] Too many connections

The problem is, that this error is being spammed hundreds of times, until the lambda function times out, after which it starts another function, which immediately gives the same error, looping again and again.

This has happened 15 times in 3 seconds, after which it stopped (somehow). The server stops functioning completely at this point, until I redeploy it.

The reason I'm submitting this here is that I have only ever seen this issue when running the application on Lambda, and the error handling is fatal.

@migeruj
Copy link

migeruj commented Jul 2, 2021

Hi, this also happens to me.
Rocket.rs is fully synchronous at the moment. When you use RDBMS on serverless the usual problem is sessions. When you use r2d2 to create a pool you are creating one connection per core. Check if your database runs out of connections. I think we should look for a way to handle a pool on serverless or wait for the rocket.rs 0.5 version (currently on dev) which is already set up for async RDBMS.

@mwnDK1402
Copy link
Author

I'm already using Rocket 0.5. Still happens. I talked to the author of Rocket, and he said it was r2d2 handling the errors ungracefully.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants