futures-rs
futures-rs copied to clipboard
try_join_all does not short circuit for large input
trafficstars
try_join_all documentation says:
If any future returns an error then all other futures will be canceled and an error will be returned immediately
However, when try_join_all switches to FuturesOrdered for large inputs, this is not longer the case: implementation processes future results in order, and if first future is slow, and second future is already finished, try_join_all won't return immediately, but will wait for first slow future completion.
@JakobDegen made an example reproducing this issue: playground.