-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Incorrect results returned from query under heavy load #24332
Comments
I'm not on the EF Core team, but are you accidentally sharing your They should be (if injected) at something like a Scope level (per-request), and not Singleton. If you inject the context into a repository/broker class, perhaps check too that it's not being shared (and thus the dependency You can double-check this by just printing out something as simple as the hash code ( |
Try the latest SqlClient 2.1.2 (assume you are on Linux) |
EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it. BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions. |
We were able to create a sample project and reproduce but not before the issue was closed. Incidentally, a few days after we opened this issue, the fix was released in dotnet/SqlClient#950. With this fix we can no longer produce the incorrect data issue. Also, thanks to ErikEJ for the great tip! Explicitly including SqlClient 2.1.2 also fixed the problem. |
Incorrect results returned from query under heavy load
One of our services was recently subject to a DDoS attack. The attack created elevated access to a single Azure Sql table. During the attack, reads from the same table threw expected timeout errors like
and
However, we occasionally saw the following error:
In addition to these errors we noticed that successful queries against the aforementioned table would return incorrect data. The code in question looks something like this:
After some investigation we added the following snippet just after the query:
which resulted in many exceptions and logs indicating that the customer data returned from the query was different from the requested customer data.
We were also able to reproduce this problem in our test environment.
Steps to reproduce
Note: we did decrease the maximum connection pool size to more easily reproduce the problem in the test environment.
Details
Microsoft.EntityFrameworkCore v3.1.12
Microsoft.EntityFrameworkCore.SqlServer v3.1.12
NETCoreApp v3.1.10
The text was updated successfully, but these errors were encountered: