-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Akka.Streams: System.NotSupportedException
when disposing stage with materialized IAsyncEnumerable
#6280
Comments
I know I brought it up on Discord but to put it on record.. Is it worth making this change in #6268 ?
The main difference is that the |
I think so - having more consistent / clean termination behavior is probably best. If users want re-runnable IAsyncEnumerables they'd be better off restarting the graph IMHO. |
Looks like we have a test case that should cover this already akka.net/src/core/Akka.Streams.Tests/Dsl/AsyncEnumerableSpec.cs Lines 208 to 228 in ae953d0
Stepping through with the debugger, I don't see it throw in this test. It does consistently in my reproduction application though. |
Related: dotnet/runtime#51176 |
Yep, this is the reason why I suspect: |
Yeah what we're doing is illegal, per Stephen Toub https://learn.microsoft.com/en-us/archive/msdn-magazine/2019/november/csharp-iterating-with-async-enumerables-in-csharp-8#much-ado-about-threading
Right call here is to not attempt to dispose the |
closed via #6290 |
Fixes akkadotnet#6280 We no longer attempt to dispose IAsyncEnumerators inside Source stages due to the reasons outlined here: akkadotnet#6280 (comment) This prevents the log from being filled with NotSupportedException warnings from failed DisposeAsync operations. (cherry-picked from 3156272)
…` bug (#6296) * Backports #6290 Fixes #6280 We no longer attempt to dispose IAsyncEnumerators inside Source stages due to the reasons outlined here: #6280 (comment) This prevents the log from being filled with NotSupportedException warnings from failed DisposeAsync operations. (cherry-picked from 3156272) * post-merge fix Co-authored-by: Aaron Stannard <[email protected]>
Version Information
Version of Akka.NET? v1.4.46, v1.5.0-alpha3
Which Akka.NET Modules? Akka.Streams
Describe the bug
When running a
Source<T>
built from anIAsyncEnumerable<T>
, any attempt to dispose theIAsyncEnumerable<T>
via itsDisposeAsync()
method results in the following exception being thrown:To Reproduce
I don't have a clean reproduction of this issue yet, but using the following in LinqPad with Akka.NET v1.4.46 installed:
I was able to trigger another bug with this stage:
As for the error with this code - I'll try another reproduction but I think it happens when
IActorContext
used to materialize theIAsyncEnumerable
source is terminated.Expected behavior
IAsyncEnumerable
stages should be able to shut down correctly.Actual behavior
The
IAsyncEnumerable
stage errs in various ways, which aren't properly supported right now.The text was updated successfully, but these errors were encountered: