-
Notifications
You must be signed in to change notification settings - Fork 626
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
FuturesUnordered: Do not poll the same future twice per iteration #2333
Conversation
I think my only concern here is whether the futures are guaranteed to not have their order changed during a single call to It doesn't solve the underlying issue, but does make things at least a bit more sane. |
Good point. futures-rs/futures-util/src/stream/futures_unordered/ready_to_run_queue.rs Lines 45 to 49 in ddbf522
futures-rs/futures-util/src/stream/futures_unordered/mod.rs Lines 425 to 427 in ddbf522
So, my understanding is that the order doesn't change. But I might have missed something. |
…per iteration Same as rust-lang#2333. The same issue exists in 0.1, so backporting it there helps for code that is still using Futures 0.1 in some places.
…per iteration Same as rust-lang#2333. The same issue exists in 0.1, so backporting it there helps for code that is still using Futures 0.1 in some places.
…per iteration Same as rust-lang#2333. The same issue exists in 0.1, so backporting it there helps for code that is still using Futures 0.1 in some places.
Summary: Those newer versions of Futures have compatibility improvements with Tokio, notably: - rust-lang/futures-rs#2333 - rust-lang/futures-rs#2358 Reviewed By: farnz Differential Revision: D26778794 fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
Summary: Those newer versions of Futures have compatibility improvements with Tokio, notably: - rust-lang/futures-rs#2333 - rust-lang/futures-rs#2358 Reviewed By: farnz Differential Revision: D26778794 fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
Summary: Those newer versions of Futures have compatibility improvements with Tokio, notably: - rust-lang/futures-rs#2333 - rust-lang/futures-rs#2358 Reviewed By: farnz Differential Revision: D26778794 fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
Summary: Those newer versions of Futures have compatibility improvements with Tokio, notably: - rust-lang/futures-rs#2333 - rust-lang/futures-rs#2358 Reviewed By: farnz Differential Revision: D26778794 fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
Summary: Those newer versions of Futures have compatibility improvements with Tokio, notably: - rust-lang/futures-rs#2333 - rust-lang/futures-rs#2358 Reviewed By: farnz Differential Revision: D26778794 fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
Summary: Those newer versions of Futures have compatibility improvements with Tokio, notably: - rust-lang/futures-rs#2333 - rust-lang/futures-rs#2358 Reviewed By: farnz Differential Revision: D26778794 fbshipit-source-id: 5a9dc002083e5edfa5c614d8d2242e586a93fcf6
Instead of using a constant, use the length of FuturesUnordered to ensures that each future is polled only once at most per iteration. This does not solve the fundamental problem, but should be able to improve the current situation somewhat.
This fixes at least one of the problems reported in tokio-rs/tokio#3493. See that issue for details of the bug.
r? @cramertj @jonhoo
cc #2053