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 panic when dropping LocalSet #1843

Merged
merged 2 commits into from Nov 27, 2019
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Nov 27, 2019

Motivation

It turns out that the Scheduler::release method on LocalSet's
Scheduler is called, when the Scheduler is dropped with tasks
still running. Currently, that method is unreachable!, which means
that dropping a LocalSet with tasks running will panic.

Solution

This commit fixes the panic, by pushing released tasks to
pending_drop. This is the same as BasicScheduler.

I've also added a test that reproduces the panic. The test fails
against master.

Fixes #1842

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

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
it turns out that the `Scheduler::release` method on `LocalSet`'s
`Scheduler` *is* called, when the  `Scheduler` is dropped with tasks
still running. Currently, that method is `unreachable!`, which means
that dropping a `LocalSet` with tasks running will panic.

This commit fixes the panic, by pushing released tasks to
`pending_drop`. This is the same as `BasicScheduler`.

Fixes #1842

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@carllerche carllerche merged commit 524e663 into master Nov 27, 2019
@carllerche carllerche deleted the fix-localset-panic branch November 28, 2019 04:10
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
Development

Successfully merging this pull request may close these issues.

LocalSet drop impl panics when dropped with unfinished futures
2 participants