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 infinite loop when dropping a LocalSet #1892

Merged
merged 10 commits into from
Dec 4, 2019
Merged

Commits on Dec 3, 2019

  1. task: add test reproducing issue #1885

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    abd28ac View commit details
    Browse the repository at this point in the history
  2. task: clear LocalSet's remote queue on drop

    Fixes #1885
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    4f46ac6 View commit details
    Browse the repository at this point in the history
  3. task: reduce duplication between basic_scheduler and LocalSet

    This commit factors out the common task queue logic in the basic
    scheduler runtime and the `LocalSet` struct in `tokio::task`. This is
    because as more work was done on the `LocalSet`, it has gotten closer
    and closer to the basic scheduler in behavior, and factoring out the
    shared code reduces the risk of errors caused by `LocalSet` not doing
    something that the basic scheduler does.
    
    In particular, I noticed the basic scheduler has a flag that indicates
    the remote queue has been closed, which is set when dropping the
    scheduler. This prevents tasks from being added after the scheduler has
    started shutting down, stopping a potential task leak. Rather than
    duplicating this code in `LocalSet`, I thought it was probably better to
    factor it out into a shared type.
    
    There are a few cases where there are small differences in behavior,
    though, so there is still a need for separate types implemented _using_
    the new `Queues` struct. However, it should cover most of the identical
    code.
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    90b5b1f View commit details
    Browse the repository at this point in the history
  4. review feedback

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    7d78ba6 View commit details
    Browse the repository at this point in the history
  5. reword comments

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    03357f1 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2019

  1. refactor/review feedback

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    a01f596 View commit details
    Browse the repository at this point in the history
  2. move Queues to its own mod, rename to SingleThreadQueues

    this should hopefully make it clearer that these are not used by the
    threadpool.
    
    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    fa878c6 View commit details
    Browse the repository at this point in the history
  3. review feedback

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    16895d5 View commit details
    Browse the repository at this point in the history
  4. rename again (thanks @jonhoo!)

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    6fd52ea View commit details
    Browse the repository at this point in the history
  5. basic scheduler no longer needs to be pub(crate)

    Signed-off-by: Eliza Weisman <eliza@buoyant.io>
    hawkw committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    c605225 View commit details
    Browse the repository at this point in the history