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

task: fix LocalSet failing to poll all local futures #1905

Merged
merged 2 commits into from
Dec 5, 2019

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Dec 5, 2019

Motivation

Currently, a LocalSet does not notify the LocalFuture again at the
end of a tick. This means that if we didn't poll every task in the run
queue during that tick (e.g. there are more than 61 tasks enqueued),
those tasks will not be polled.

Solution

This commit fixes this issue by changing local::Scheduler::tick to
return whether or not the local future needs to be notified again, and
waking the task if so. I've also added a test that reproduces this.

Thanks @carllerche for figuring this out!

Fixes #1899
Fixes #1900

Signed-off-by: Eliza Weisman eliza@buoyant.io

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Currently, a `LocalSet` does not notify the `LocalFuture` again at the
end of a tick. This means that if we didn't poll every task in the run
queue during that tick (e.g. there are more than 61 tasks enqueued),
those tasks will not be polled.

This commit fixes this issue by changing `local::Scheduler::tick` to
return whether or not the local future needs to be notified again, and
waking the task if so.

Fixes #1899
Fixes #1900

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw added the C-bug Category: This is a bug. label Dec 5, 2019
@hawkw hawkw requested review from carllerche and a team December 5, 2019 19:25
@hawkw hawkw self-assigned this Dec 5, 2019
Copy link
Member

@carllerche carllerche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@carllerche carllerche merged commit b7ecd35 into master Dec 5, 2019
@carllerche carllerche deleted the eliza/fix-localset-notify branch January 10, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
2 participants