Skip to content
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

Backport to 0.1: Avoid starvation from FuturesUnordered::poll_next #2122

Merged
merged 1 commit into from Apr 22, 2020

Conversation

krallin
Copy link

@krallin krallin commented Apr 10, 2020

This backports #2049 to the
0.1 branch. Without this change, polling > 200 futures trough a
FuturesUnordered on a Tokio 0.2 executor results in a busy loop in
Tokio's cooperative scheduling module.

See for a repro of where this breaks:
tokio-rs/tokio#2390

Tested by running the reproducer I submitted there. Without this change,
it hangs forever (spinning on CPU). With the change, it doesn't.

This backports rust-lang#2049 to the
0.1 branch. Without this change, polling > 200 futures trough a
FuturesUnordered on a Tokio 0.2 executor results in a busy loop in
Tokio's cooperative scheduling module.

See for a repro of where this breaks:
tokio-rs/tokio#2390

Tested by running the reproducer I submitted there. Without this change,
it hangs forever (spinning on CPU). With the change, it doesn't.
@cramertj
Copy link
Member

Thanks for the backport!

@taiki-e taiki-e mentioned this pull request Sep 30, 2020
@taiki-e taiki-e added the futures-0.1 Issue related to the 0.1 versions of futures label Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
futures-0.1 Issue related to the 0.1 versions of futures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants