You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Await is required to yield results in order via AsOrdered, the task-based functions are still evaluated concurrently. If any one evaluation/task fails then Await will throw eagerly, possibly never yielding results that were successfully evaluated. Let's suppose that evaluations A, B and C are done asynchronously and concurrently but require results to be yielded in that same order. While A and B are in flight, C fails; Await will throw and attempt to abort the other two. This is a good thing because it means that there is no point in doing work if we know some future result will be an error. However, what if Await was combined with Take(2)? Such a computation would have terminated successfully! Bailing out eagerly seems to be the incorrect behaviour when results are requested in source-order.
It's interesting to note that PLINQ appears to abort eagerly as well when its AsOrdered is used. This observation is based on experimentation because the documentation doesn't call-out the behaviour explicitly.
I'm tagging this as a discussion before declaring it a bug.
This discussion was converted from issue #438 on November 11, 2022 11:32.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When
Await
is required to yield results in order viaAsOrdered
, the task-based functions are still evaluated concurrently. If any one evaluation/task fails thenAwait
will throw eagerly, possibly never yielding results that were successfully evaluated. Let's suppose that evaluations A, B and C are done asynchronously and concurrently but require results to be yielded in that same order. While A and B are in flight, C fails;Await
will throw and attempt to abort the other two. This is a good thing because it means that there is no point in doing work if we know some future result will be an error. However, what ifAwait
was combined withTake(2)
? Such a computation would have terminated successfully! Bailing out eagerly seems to be the incorrect behaviour when results are requested in source-order.It's interesting to note that PLINQ appears to abort eagerly as well when its
AsOrdered
is used. This observation is based on experimentation because the documentation doesn't call-out the behaviour explicitly.I'm tagging this as a discussion before declaring it a bug.
Beta Was this translation helpful? Give feedback.
All reactions