-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Multiple concurrent queries InvalidOperationException
#34882
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
Conversation
It will be interesting to see how they implement the fix seeing how this threading issue is not resolved by simple CancellationToken. It only pushes it deeper. The proposed implementation is better, but it still throws an exception, two in fact. If you type fast enough, following exceptions might be thrown: System.InvalidOperationException and System.Threading.Tasks.TaskCanceledException. The more frequent exception is thrown by the EF Core itself. From the EF ExecuteAsync documentation:
The less frequent exception is thrown by the SQL provider. It is Micrsofot.Data.SqlClient.SqlException wrapped in System.InvalidOperationException (0x80131904): The request failed to run because the batch is aborted, this can be caused by abort signal sent from client, or another request is running in the same session, which makes the session busy. I suggest following changes to the sample:
Exceptions that need handling:
|
Best to place any discussion on it on their issue. This is closed, and the docs tracking issue will react to whatever they do. I'm watching them 👁️. If Javier likes your approach better than the workaround that he provided (the one in the article now), then he should let me know that he would like it swapped in. Then, I'll open a new issue to take care of it. Ask him on their issue if he likes your proposal better. |
Addresses #34881
Thanks @MagistratasHK! 🚀 ...
Cross-references:
I'm going to add a section to the QuickGrid article, and I'm even going to provide the full-blown replacement component for the
Index
component in the tutorial as the example here. That makes it easy to understand the before-and-after changes required. As Javier remarked, "[this] is not trivial." 😆I won't take the extreme measure of changing the entire component in the tutorial because the simpler component, prone to the error, is scaffolded into to the app. There's also a good chance that the original code won't change. I suspect that they'll fix the problem inside the items provider. That will make my work easy here because I'm setting up this new section for <10.0, so the entire section will drop out of coverage automatically in November when 10.0 releases and only appear to readers when they're looking at an earlier version of this article.
I'll leave this up until EOD to give you a chance to look it over and provide feedback. The original issue for this work won't close because I'll need to keep an 👁️ on the product unit issue and see if I need to make further updates later.
Internal previews