-
Notifications
You must be signed in to change notification settings - Fork 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
When clients dispose an IAsyncEnumerator, the AsyncEnumerableGrainExtension can throw a NotSupportedException #9185
Comments
Thanks for reporting, @Tragetaschen. I can reproduce the issue here and am working on a fix |
@Tragetaschen I've opened #9186 to address this |
I thought about this as fix before as well, but discarded it: Or is there already support for native CancellationTokens on grain interfaces? 😁 |
It is possible, though, to accept a CancellationToken without support on the Grain interface: public IAsyncEnumerable<int> GrainInterfaceMethod() {
return GrainInterfaceMethodImpl(default);
async IAsyncEnumerable<int> GrainInterfaceMethodImpl([EnumeratorCancellation] CancellationToken cancellationToken) {
yield return 420;
await Task.Delay(100, cancellationToken);
yield return 69;
}
} The |
Hopefully, we can add native CancellationToken support for grain calls soon. There is a PR open that I need to review more and think about more (propagating cancellation down a call chain is a subtle topic) |
I've seen in my logs exceptions similar to this
As far as I can tell, the AsyncEnumerableGrainExtension has a bug, where the enumerator's DisposeAsync method is unconditionally called while there still might be an incomplete
enumerator.MoveNextAsync
task "running".orleans/src/Orleans.Core/Runtime/AsyncEnumerableGrainExtension.cs
Lines 52 to 55 in 148e478
The C# compiler's state machine for an
IAsyncEnumerable
contains an explicit check for this condition and throws aNotSupportedException
. It's a bit cumbersome, but can be seen hereThe text was updated successfully, but these errors were encountered: