-
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: weird behavior with RepeatPrevious
#7217
Comments
Accidentally tagged the wrong issue on #7219 |
It is the
What happens internally inside the
As you can see, there are 3 pushes and then the source completes the stream. The element "C" was repeated twice. |
Lets say that in the original reproduction case, we'll make source2 and source3 to never complete the stage by adding this code:
The output became what we (kind of) expected:
The first element of any source tagged with |
I guess not, because the spec itself specify that there will always be a side-effect of repeated element. We can mitigate this by introducing a default value initializer to |
@Arkatufus semantically, I think both code samples should behave identically - that we're never moving past the initial elements onto the older ones is a bug. |
No, that is impossible because |
This is also the wrong solution for fixing this issue - upstreams aren't being pulled, by the looks of it. That the stream terminates without exhausting the values of any of the original |
I guess that's a fair point, but then why do we get 2 elements instead of 1? |
I guess we'd need to wrap the source inside a "Repeat" behavior, similar to |
The 2 repeating elements are part of the spec |
"When there were no buffered last value, we will pull", that causes the double first element. A default value will mitigate that, at least it gives the user some agency in detecting that nothing was pulled yet |
Ugh, yeah I remember reasoning about this in the original implementation now - it takes an extra pull to kill it when the upstream is dead. And the reason why the graph terminates is because we don't want to keep a dead |
Version Information
Version of Akka.NET? v1.5.20
Which Akka.NET Modules? Akka.Streams
Describe the bug
Consider the following code:
We get the following output:
Expected behavior
I would expect we would get at least 4 elements - 1 for each of the items in
source1
. Why don't we?Actual behavior
We only get 2 elements - and we never have a single "Fahrenheit" element appear.
Additional context
This could be a misconfiguration with how the various sources are being zipped together, but it doesn't read that way to me - this seems legitimate and like it should produce 4 total elements.
The text was updated successfully, but these errors were encountered: