Skip to content

System.Text.Json will attempt to dispose IAsyncEnumerators on exception while there are pending MoveNextAsync operations #57360

Description

@eiriktsarpalis

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions