futures-rs icon indicating copy to clipboard operation
futures-rs copied to clipboard

try_join_all does not short circuit for large input

Open stepancheg opened this issue 1 year ago • 0 comments
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

source

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.

stepancheg avatar Jun 26 '24 15:06 stepancheg