-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Milestone
Description
An unexpected behavior has been observed while working with IAsyncEnumerable and we try to cancel it.
A method returning an IAsyncEnumerable, which internally fetches data from the Channel, encounters no issues to be cancelled when there is data in it.
However, if the Channel is empty and the cancellation is requested, there is no execution of code block in the try/finally within the grain.
There is a demo repo to explain this problem in detail.
You'll find three branches detailing various attempts to resolve this issue during our testing phase:
- main: The channel has data and the cancellation works as expected.
- empty_iasyncenumerable: The channel is empty and the cancellation is called but it didn't cancel the grain code.
- graincancellationtoken: We tried to pass a GrainCancellationToken to the GetCount method and initiate its cancellation upon request from another CancellationToken but unfortunately, the cancellation process did not succeed. Same behavior as in empty_iasyncenumerable.
We would greatly appreciate any assistance on this matter.
Thank you!
seniorquico, mchangus-salad and pkudrel