-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
System.Text.Json will attempt to dispose IAsyncEnumerators on exception while there are pending MoveNextAsync operations #57360
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsRelated to #51176 (comment). Compiler-generated async enumerators will throw NotSupportedException if an attempt is made to dispose them while a Originally posted by @eiriktsarpalis in dotnet/aspnetcore#35330 (comment)
|
See dotnet/aspnetcore#35330 (comment) for the original report. Issue related to #50851. |
…Disposable instances are disposed exactly once. Fixes dotnet#57360.
* Ensure WriteStack.Pending task is awaited on exception. Ensure IAsyncDisposable instances are disposed exactly once. Fixes #57360. * Update src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs
Related to #51176 (comment). Compiler-generated async enumerators will throw NotSupportedException if an attempt is made to dispose them while a
MoveNextAsync()
task is pending completion. It would seem like STJ is doing this when serialization is cancelled due to a cancellation token firing. It's a bug and we need to fix it.Originally posted by @eiriktsarpalis in dotnet/aspnetcore#35330 (comment)
cc @davidfowl @stephentoub
The text was updated successfully, but these errors were encountered: