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
Re-Opening connection hangs after successful query within scope of Http Request #1878
Comments
This is highly unlikely to be a Pomelo issue. Instead, this is highly likely to be a connection exhaustion issue on your MySQL server. You might be able to resolve the issue for the moment, if you restart the MySQL server instance. However, the issue might appear again after a while, depending on the settings of your MySQL server instance and on the connection pool settings of all apps that use this server (not just the app that you are working on). @rossbroom99 So if you can restart the server, do so and do not let any other app connect to the server for the moment, except for the one that your experienced the issue with. If it works fine now, it was likely a connection exhaustion issue. If it still does not work, we will assist you in investigating further. (Alternatively, connect to a fresh MySQL server instance, that is not used by another app, e.g. from a fresh docker image.) Depending on your findings, there are different steps to take, to ensure this does not happen again. So please report back to us. |
I was seeing something similar to this recently actually. It seemed to keep the connections open and sometimes repeating them which was often prompting SSL failures for some weird reason. |
@CollinHerber Please fill-out the
Please post the exact MySQL/MariaDB version (e.g. An exception message with a full stack trace would be great! How often does this issue appeared overall? Does this appear on every app run? Is it non-deterministic in nature or can it reliably be reproduced? |
@CollinHerber Any update on this? |
I found the original issue posted on reddit |
Steps to reproduce
I think this will be hard to reproduce as I've really got the bare minimum so it should be working. I have starter weather forecast Asp.Net Core Web Api, scaffolded db context from existing MySql Database, Added Db Context to DI via .AddDbContext, have 3 queries in the default controller.
The issue
I have the bare minimum so I'm assuming it is a Pomelo issue, I can't see any reason why this wouldn't work. I've used EF Core for years.
TLDR; Ef core executes first query in HTTP request fine, then closes connection, second query in the same HTTP requests hangs when EF core tries to reopen the connection. It is consistent.
Details:
Dk1 executes fine and returns me back my entity, anything after this just hangs on opening connection! I have no idea what this could be. When the request eventually times out and I hit the endpoint again, it's the same thing, first query works fine and then hangs on opening the connection again. I've checked max connection size on my database and we are no where near exceeding that, and it's the fact that it's consistently only hanging on subsequent queries after the first one within the scope of the request.
This is the stack trace when it eventually times out.
Further technical details
MySQL version: 5.7.12
Operating system: Windows 11
Pomelo.EntityFrameworkCore.MySql version: 8.0.0-beta-2 (tried with latest version as well)
Microsoft.AspNetCore.App version: Latest
Other details about my project setup:
Ef Core 8
.NET 8
The text was updated successfully, but these errors were encountered: