-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Refactor SelectAsync to use Try<T>
#7537
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
Refactor SelectAsync to use Try<T>
#7537
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
# Conflicts: # src/core/Akka.Streams/Implementation/Fusing/Ops.cs
|
Hey guys, I think this is not a I managed to reproduce this bug (on our code-base) and actually managed to also get the debugger involved. I had to do a LOT of iterations to get here: So, the problem actually is that these are the element types flowing through that one of which is a Vogen value-object... WHICH, in case it is This actually tells us that the problem is two fold:
⚠ BUT this also tells us this is NOT a IMO, you guys could easily go ahead with the alternate fix where you keep the This is the entire code needed to reproduce it 100% of the time: I agree that this is a VERY rare case, but not rare enough that we were able to "avoid" it. |
|
@tomachristian need to look closer but what about a struct like this help? https://github.com/akkadotnet/akka.net/pull/7028/files#diff-14e21d13541082820f403edfa36d29c58688f2a3e45d5ea97978b9ce5be41456 Main reason I bring it up is, this is a bit more compact than |
|
@to11mtm you mean to replace our ValueTuple usage and avoid this problem? Yes of course, now knowing the actual root cause we have various ways to avoid/workaround this problem in our code-base, no problem. But IMO, still, this should be fixed in Akka and rely on the |
Yep, this is a good argument - perserves perf (there is no boxing with our stuff currently, AFAIK) |
There is some that may be happening depending on specifics (Interpreter/fusing comes to mind, see #7116) but ironically, getting rid of boxing by converting 'very' nongeneric methods into generics is sometimes counterintuitive due to the code complexity cost of reification.... (OTOH, ValueTuples are overall a little suss because equality operators can result in unintended refiication cost, doubly so when you -don't- need equality on the item itself...) tl;-dr; Overall I think SlimResult is probably better than current result struct (We could always introduce it as new API, that would also make it easier to transition for internal and users) but boxing in interpreter/etc is a whole hill of beans, 7116 showed we could lower alloc on boxing in streams (possibly more relevant for specific cases but still good for enough common cases to consider...) perf is very dependent on pool strategy however... Sorry., probably went too far, that said AFAIK Reference-reference equality checks are not going to have a 'torn' read risk, vs the current state of Heck, if one wanted to be extra 'lazy/paranoid' they could instead have null exception (i.e. no sentinel) on SlimOption trigger a spinwait and/or full fense.... ugly but may help sniff out any other not-quite-conforming things in streams implementations... |
|
What is |
|
closed via #7543 |
Pull request was closed
It's part of my (now stale ;_;) #7028 PR. I linked in prior comment to the struct in question (i.e. 'would something like this help') but here's a link to keep it simple: https://github.com/akkadotnet/akka.net/pull/7028/files#r1496813859 |
Help me get the PR validation pipeline to succeed with a 95% pass rate on PRs that run the full solution build - and after that I might consider merging in something that complicated :p |



No description provided.